「VB.NET」フォームのサイズ(Width,Height)を指定

2021年10月1日

書式
フォーム名.Width = 幅のピクセル
フォーム名.Height = 高さのピクセル
使用例

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()
'フォームのWidthプロパティ
frm2.Width = 400
'フォームのHeightプロパティ
frm2.Height = 300
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() 'フォームのWidthプロパティ frm2.Width = 400 'フォームのHeightプロパティ frm2.Height = 300 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()
    'フォームのWidthプロパティ
    frm2.Width = 400
    'フォームのHeightプロパティ
    frm2.Height = 300
    frm2.Show()

End Sub

 

VB.net

Posted by arkgame