We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How do I trap for "Enter" in a ButtonEdit Control

I''m trying to trap the enter key so that I can validate what was inputed in the Textbox when the user pressed the Enter Key. I tried using the KeyPress, KeyDown, KeyUp and none of those events where triggered. Any help would be appreciated. Thank you, Javier

2 Replies

AD Administrator Syncfusion Team August 4, 2004 02:34 AM UTC

Hi Javier, You would have to derive from the ButtonEdit control to create a custom ButtonEdit control and then override its ProcessCmdKey method as shown below : public class CustomButtonEdit : ButtonEdit { public CustomButtonEdit () : base() { } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.Enter)) { MessageBox.Show("ButtonEdit Validated!"); return true; } return base.ProcessCmdKey (ref msg, keyData); } } Please refer to the complete sample that illustrates this and let me know if it meets your requirements. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

AD Administrator Syncfusion Team August 4, 2004 02:49 PM UTC

Perfect....thank you very much....

Live Chat Icon For mobile
Up arrow icon