Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting focus on a field
Message
From
24/08/2010 21:41:11
 
 
To
24/08/2010 21:35:44
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01478155
Message ID:
01478282
Views:
24
>Normally, the Focus() method of a control is used to move the focus to that control:
>
>
>private void MyButton_Click(object sender, System.EventArgs e)
>{
>    // Move the Focus elsewhere
>    this.MySpecialTextBox.Focus();
>}
>
>
>This works at any time, except during Form/Control Load. Then, you simply have to
>set the ActiveControl:
>
>
>private void MyForm_Load(object sender, System.EventArgs e)
>{
>    // Start the Form with the Focus on a certain control
>    this.ActiveControl = this.MySpecialTextBox;
>}
>
You are right. I completely forgot about that. This works. Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform