WANTED: Winforms Recipes

Having spent the best part of 7 years working in C# Winforms, it’s still not 100% clear which is the best way to handle a user’s interaction with a humble TextBox. The .Net framework offers many events that can be used to manage behaviour, but I’ve never seen any documentation stating the “Best way” or the “Right way” to do it.

Take for example a simple interaction. I have a simple textbox, and would like to perform an action once the user has typed the value and hit [Enter]. Which event should I use ? Validated, Validating, KeyPress, Leave ?

I know it all depends upon the exact scenario, but hey, Microsoft, throw us a bone!

Advertisements

Leave a comment

Filed under C#, UI Hints, Winforms

Scripting iTunes

Love it or hate it, iTunes is a massively popular piece of software, not because it’s fast, good looking or ultra-usuable, but because you need it if you’re one of the millions and millions of people that own an iPhone, iPad or iPod.

However, I was recently very pleasantly surprised when I found that iTunes has a COM interface that allows you to very easily script actions – such as bulk renaming your tracks, or bulk-editing track metadata

Although I’m a C# developer, one of the most convenient ways to access this functionality was actually JScript:

var iTunesApp = WScript.CreateObject("iTunes.Application");

I wrote a script to take some videos that were showing as “Movies” section in iTunes, and changed the metadata (“Media Kind”, “Episode Number” and “Season Number”)  and made them show up in the “TV Shows” section of iTunes.

Useful Links:

Leave a comment

Filed under Apple, Useful