I've put this code (just these two lines, nothing more) in the KeyDown event handler for a combobox. It works fine and keeps up with a user's normal typing speed. (So does KeyUp).
keysSoFar is a stringbuilder
keysSoFar.Append(e.KeyCode.ToString)
Debug.WriteLine(keysSoFar.ToString)
The equivalent code in the KeyPress event handler for the same combobox stalls, unable to keep up with the user's keystrokes.
keysSoFar.Append(e.KeyChar.ToString)
Debug.WriteLine(keysSoFar.ToString)
I have only one of the handlers compiled during a test so there's no combinatorial issue.
I want to use KeyPress so I don't have to deal with all the non-printing key codes.
Is the delay due to a difference between the KeyDown and KeyPress processing
Or is it due to the difference in the way StringBuilder handles KeyCode and KeyChar
All help appreciated,
Gus