Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
UltraCombo 7& UltraComboEditor KeyPress event issue
posted

I'm trying to trap the key press event for the Delete Key and the Period key.  By using a case statement on e.KeyChar and the specific case labels of Chr(Keys.Delete) and Chr(Keys.Decimal), I expected to detect when the user was pressing either the Delete Key or attempting to enter a decimal point.  To my surprise, pressing the decimal point (period) causes the Chr(Keys.Delete) to fire and pressing the Delete Key does not fire any event that I can detect.  How can I tell the difference between these two keystrokes when using the UltraComboEditor or UltraCombo?

Thanks,

--George

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi George,

    Have you tried this for any other controls, like the inbox ComboBox or TextBox controls?

    I suspect that the first issue is just a quirk of the way the KeyChar property works. I've seen issues in Visual Studio like this before and there is some reason for it that I cannot remember right at the moment.

    If you could post the code you are using to actually examine the KeyChar, it might help.

    As for the Delete key, navigation and non-visible keys like delete don't fire the KeyPress event for any controls, as far as I know. You have to use KeyDown or KeyUp. I tried it out and both of those events fire for me. If they are not firing for you, then my guess is that your application has a Toolbar or a menu which is using DEL as a shortcut and so it's intercepting and handling the character before it gets to the UltraComboEditor.

     

Children
No Data