How to intercept capture TAB key in WinForms application?

Posted by Axarydax on Stack Overflow See other posts from Stack Overflow or by Axarydax
Published on 2010-03-17T10:39:19Z Indexed on 2010/03/17 10:41 UTC
Read the original article Hit count: 395

Filed under:
|
|
|

Hi, could you please help me with this one? I'm trying to capture Tab key in Windows Forms application and do a custom action on it.

I have a Form with several listViews and buttons, I've set Form's KeyPreview property to true and when I press any other key than tab, my KeyDown event handler does get called. But that's not true with the Tab key - I don't receive WM_KEYDOWN message even in WndProc. Do I need to set each control inside my form - its TabStop property - to false? There must be a more ellegant way that that. Thanks.

© Stack Overflow or respective owner

Related posts about keystroke

Related posts about .NET