Select RadTextBox in RadForm on Load

3 posts, 1 answers
  1. Mark
    Mark avatar
    10 posts
    Member since:
    May 2016

    Posted 09 Dec 2016 Link to this post

    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. Answer
    Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 12 Dec 2016 Link to this post

    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.
  3. Mark
    Mark avatar
    10 posts
    Member since:
    May 2016

    Posted 12 Dec 2016 in reply to Dimitar Link to this post

    It worked, Thanks!
Back to Top