一个很简单的例子: Dim l As Single Dim t As Single Dim w As Single Dim h As Single Private Sub Form_Load() l = Command1.Left / Me.Width t = Command1.Top / Me.Height w = Command1.Width / Me.Width h = Command1.Height / Me.Height End Sub Private Sub Form_Resize() Command1.Left = l * Me.Width Command1.Top = t * Me.Height Command1.Width = w * Me.Width Command1.Height = h * Me.Height End Sub
Dim l As Single
Dim t As Single
Dim w As Single
Dim h As Single
Private Sub Form_Load()
l = Command1.Left / Me.Width
t = Command1.Top / Me.Height
w = Command1.Width / Me.Width
h = Command1.Height / Me.Height
End Sub
Private Sub Form_Resize()
Command1.Left = l * Me.Width
Command1.Top = t * Me.Height
Command1.Width = w * Me.Width
Command1.Height = h * Me.Height
End Sub
用 resize 这个控件吧?在哪里啊??