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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

17217 Aug 3,2004 10:04 PM UTC Aug 4,2004 02:49 PM UTC Windows Forms 2
loading
Tags: Tools
Administrator [Syncfusion]
Asked On August 3, 2004 10:04 PM UTC

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

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On August 4, 2004 02:49 PM UTC

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;