I'm starting to put together an activation dialog as part of my application. I really like the way Microsoft did theirs recently with Windows 7, more specifically the way the hyphens that separate each quintet of the product key are added and removed automatically.
After taking a quick look at it, it seems like it's a bit more difficult to implement smoothly than I had first though. That or I've been starring at the issue for too long. Is there any sample code or tutorial that reproduces this behavior for a TextBox?