This is a migrated thread and some comments may be shown as answers.

Select RadTextBox in RadForm on Load

2 Answers 76 Views
Form
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 09 Dec 2016, 08:43 PM

I have a RadForm that contains multiple Radtextboxes. How can I have one of them be the focused box once the form has opened?

I have tried placing both lines of code below in the constructor but neither initialize the cursor in the iUSERNAME text box.

this-object:iUSERNAME:Focus(). 
this-object:iUSERNAME:Select(). 

 

Thanks

Mark

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 12 Dec 2016, 10:57 AM
Hello Mark,

This will work when the form is already visible. For example, you can use the OnShown event:
METHOD PRIVATE VOID Form1_Shown( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
    this-object:radTextBox1:Focus().
    RETURN.
 
END METHOD.

I hope this information is useful. Let me know if you need further assistance.

Regards,
Dimitar
Telerik by Progress
Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
0
Mark
Top achievements
Rank 1
answered on 12 Dec 2016, 04:39 PM
It worked, Thanks!
Tags
Form
Asked by
Mark
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Mark
Top achievements
Rank 1
Share this question
or