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.

MaskedEditBox and SelectAll

Thread ID:





18975 Sep 14,2004 06:48 PM Sep 16,2004 06:12 AM Windows Forms 3
Tags: Tools
Madhavi Balusu
Asked On September 14, 2004 06:48 PM

Hi, On Entering my MaskedEditBox control, I want to SelectAll the whole text/mask in the control. So I added a delegate for the "Enter" event and did m_MaskEditCtrl.SelectAll() in OnEnter, but this did not select the whole text. Infact there was no selection at all. What am I doing wrong? Here is the codesnippet: this.Enter += new EventHandler(OnEnter); private void OnEnter(object sender, EventArgs e) { this.SelectAll(); }

Administrator [Syncfusion]
Replied On September 15, 2004 09:34 AM

Hi, You could accomplish this by handling the MaskedEditBox''s GotFous event instead as shown in code below : this.maskedEditBox1.GotFocus += new EventHandler(MaskedEditBox_GotFocus); private void MaskedEditBox_GotFocus(object sender, EventArgs args) { this.maskedEditBox1.SelectAll(); } Please refer to the test sample attached that illustrates this, and let me know if this works for you. Regards, Guru Patwal Syncfusion, Inc.

Madhavi Balusu
Replied On September 15, 2004 09:53 AM

Thanks that works. I have other derived editcontrols which SelectAll in Enter event. This is the only control in which I selectall in GotFocus event. 1) Why, is this your bug? 2) For consistency can I do selectall for other edit controls like CurrencyEdit, DoubleTextBox also in GotFocus event. Or is that a bad idea?

Administrator [Syncfusion]
Replied On September 16, 2004 06:12 AM

Hi, Thanks for the update. 1. Yes, this appears to be a shortcoming in our MaskedEditBox control and we will address this issue in our future releases. 2. You could use either of the 2 events - GotFocus or Enter for our other Editor controls. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


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.

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.