Cancel a button event (VB.NET)
Posted on 2009-04-03
As usual, lot of time spent, gotten nowhere, etc. Frustration. But I'm a professional, etc.
What I am trying to do is cancel a button keyboard event. The user would like right arrow and left arrow to navigate from form to form, but instead right and left are going up and down in the dynamically drawn button list (not a real list, just controls.add(button)).
I tried 1) "return" in all the event handlers, did nothing 2) CancelEventArgs (must not know what I'm doing here, but I tried what I read online for canceling form events) and 3) to intercept windows messages via "protected sub overrides sub wndProc."
It (the event) just keeps getting through.
The navigation is taking place right now, but you can see right before you leave the form that it went up or down one button (left or right respectively), and when you get to the new form, it has the wrong selected button value.