G
Guest
I am writing a control which extends System.Windows.Forms.TextBox and adds in
the concept of EditMode vs. ReadyMode (similar to an Excel cell).
So normally when focus arrives on the control, I hide the blinking cursor
and change the mouse pointer from an I-beam to an arrow. When the user hits
certain keys, the control goes into Edit mode (for instance if they type a
letter), and the letter gets appended to the end of the string. When they're
done typing they can hit <Enter> to commit the change and go back to Ready
mode, or <Esc> to cancel the change, revert to the old Text, and go back to
Ready mode.
Unfortunately, I have to do this by hooking the KeyDown event and testing
the e.KeyCode value. However that means going through the entire list of
possible values for the System.Windows.Forms.Keys enumeration, which includes
some crazy keys like Keys.IMEAceept (sic) and Keys.Oem8 (different
manufacturers have their own '8' key?).
Is there some function in the Framework or WindowsAPI that I can call which
will tell me if a certain KeyCode ought to cause some text to appear on the
screen?
Thanks
the concept of EditMode vs. ReadyMode (similar to an Excel cell).
So normally when focus arrives on the control, I hide the blinking cursor
and change the mouse pointer from an I-beam to an arrow. When the user hits
certain keys, the control goes into Edit mode (for instance if they type a
letter), and the letter gets appended to the end of the string. When they're
done typing they can hit <Enter> to commit the change and go back to Ready
mode, or <Esc> to cancel the change, revert to the old Text, and go back to
Ready mode.
Unfortunately, I have to do this by hooking the KeyDown event and testing
the e.KeyCode value. However that means going through the entire list of
possible values for the System.Windows.Forms.Keys enumeration, which includes
some crazy keys like Keys.IMEAceept (sic) and Keys.Oem8 (different
manufacturers have their own '8' key?).
Is there some function in the Framework or WindowsAPI that I can call which
will tell me if a certain KeyCode ought to cause some text to appear on the
screen?
Thanks