Saturday, May 15, 2010

Capturing keyboard events in a form

When wishing to capture a keyboard event in winforms, one might encounter a problem that although you can register to capture the keyboard events, the events don't reach the parent form.

The simplest way is to override ProcessCmdKey and processing the message it receives.

I wonder this is so...

Wednesday, May 5, 2010

"Constructor on type 'System.String' not found"

This exception I got yesterday while trying to add an item to a collection in this string collection editor:
















I found no simple solution on the web, but after some thought had this solved by changing the property from a list to an array of strings. This changed the default editor to this simpler string collection editor that worked good enough for me: