Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select content in TextBox and NumbericUpDown up on entry.
Message
From
04/10/2004 04:44:18
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Select content in TextBox and NumbericUpDown up on entry.
Miscellaneous
Thread ID:
00948377
Message ID:
00948377
Views:
66
Hi,

When a TextBox or NummericUpDown is entered, I want the content to be selected, namely, highlighted. I have the following code in my subclass of a TextBox:

protected override void OnEnter(EventArgs e)
{
this.SelectAll();
base.OnEnter (e);
}

It is not working. I tried the OnGotFocus event too, and failed too. What's wrong?

Also, the NumericUpDown doesn't have a SelectAll() method, what do I do?

Chen
Chen Nan
Reply
Map
View

Click here to load this message in the networking platform