Things I Learned Today - Textbox.KeyPress Event Not Fired When AutoComplete
I was working on a Windows Forms application today in .NET 2.0. I set up a Textbox with an AutoCompleteMode set to append. I then set up an event handler for the KeyPress event so that I could capture when the user pressed the enter key so I could add their selection to a list. After running a quick test, I noticed that the Textbox was not recieving the KeyPress event when the enter key was pressed. I changed the AutoCompleteMode to None and voila, it captured the event again. Bug! The obvious work around is to use the KeyUp event.