Setting focus to a textbox control

后端 未结 7 930
隐瞒了意图╮
隐瞒了意图╮ 2021-02-05 15:54

If I want to set the focus on a textbox when the form is first opened, then at design time, I can set it\'s tabOrder property to 0 and make sure no other form control has a tabO

相关标签:
7条回答
  • 2021-02-05 16:48

    To set focus,

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
        TextBox1.Focus()
    End Sub
    

    Set the TabIndex by

    Me.TextBox1.TabIndex = 0
    
    0 讨论(0)
提交回复
热议问题