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)
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)
Please refer to the test sample attached that illustrates this, and let me know if this works for you.
MBMadhavi BalusuSeptember 15, 2004 01:53 PM UTC
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?
AdministratorSeptember 16, 2004 10:12 AM UTC
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.