有时候,重新设置应用程序窗口的大小时,窗体中的对象会变得很杂乱,甚至影响使用。这个时候我们要使用Resize过程。
Resize在对象的尺寸变化时,该事件过程会被触发:
看看例子就知道了:
Public Class Form13
Private Sub Form13_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Me.GroupBox1.Top = 0
Me.GroupBox1.Left = 0
Me.GroupBox1.Width = Me.Width
Me.GroupBox1.Height = Me.Height
Me.Label1.Top = Me.GroupBox1.Top + 10
Me.Label1.Left = Me.GroupBox1.Left + 10
Me.TextBox1.Top = Me.Label1.Top + 50
Me.TextBox1.Left = Me.Label1.Left
Me.TextBox1.Width = Me.GroupBox1.Width - 20
End Sub
End Class