0

I am using Winforms dialog with multiple tabs (tab1 and tab2). Both of the tabs have KeyPreview = true.

On tab1 when I hit W on my keyboard, the KeyDown (for tab1) event triggers successfully. However upon switching to tab2 and then back to tab1, the same key does not trigger anymore.

Any idea on what is causing the problem?

John Tan
  • 1,271
  • 1
  • 17
  • 34

1 Answers1

0

I found a method around this:

Basically in the OnClick method in tab1, I simply call this.Focus().

So the user has to click back onto the tab page, and he will be able to press a keyboard command after this.

John Tan
  • 1,271
  • 1
  • 17
  • 34