[VB.NET]フォームロード時のフォーカスセットサンプル

2021年10月1日

書式
フォーム名.ActiveControl = コントロール名

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm2 As New Form2()
frm2.ActiveControl = frm2.TextBox1
frm2.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm2 As New Form2() frm2.ActiveControl = frm2.TextBox1 frm2.Show() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim frm2 As New Form2()
    frm2.ActiveControl = frm2.TextBox1
    frm2.Show()
  
End Sub

 

VB.net

Posted by arkgame