How do I make MainFormKeyDown absolute GOD over everything else? I have a tabpage control, and I want CTRL+Tab to ALWAYS switch tabs. But several tabs have a Multiline edit controls that "WantTabs". I added into the EditKeyDown a handler for "Shift+Tab" to make it go back from a previous tab. But no matter what I do in the MainFormPreviewKeyDown, MainFormKeyDown, or InputEditKeyDown, I never receive any signals for Ctrl+Tab. WTF? Is KeyPreview = True a Lie, because it sure seems that way on my end.

Jaeden "Sifo Dyas" al'Raec Ruiner

10 Years
Discussion Span
Last Post by Hamrick

It's not a lie, but you might be confused about when and how a control captures key strokes. I think you want a global winndows hook

Well, that appears to be a lie to me then.

MainForm.KeyPreview is a binary equation.
1: Either it Previews EVERY key
2: It doesn't.

If it doesn't then it's a lie, and doesn't do what it says it should do.

In Delphi when you have keypreview for the main form it receives EVERY key code before any other control in the application. That's what "KeyPreview" means. But I guess I shouldn't be surprised, since KeyPreview has never worked for VBA ever, so why should they fix it now. *shrug*

A global windows hook is a bit overkill, because i'm not trying to link a key command into the system, just into my application.


Jaeden "Sifo Dyas" al'Raec Ruiner

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.