In Visual Studio 2003 and C# 1.0, I set KeyPreview to true for the form, so that while a form has the focus, I can get notified when a user presses a key on the keyboard, thusly:
private void MyForm_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
switch ( e.KeyCode )
case Keys.F5: break;
case Keys.F6: break;
case Keys.F7: break;
In this way, everything was working fine. But then I needed a MapPoint control on that form, and since I've added it, my ability to detect
the keyboard has been compromised. Now, it only works after I have opened a client form with a button click or clicked on a ListBox control on the form. From then on, keystrokes are detected fine. But I'd like it to work the first time, and without needing to know to click in these places. Clicking the form does not have the same effect as clicking in the controls I mentioned.
My question is what change can I make to the form or the control to allow me to fix this? It's puzzling, but I he there's a simple fix to it.
Thanks for the help.