- 注册时间
- 2011-3-6
- 最后登录
- 1970-1-1
该用户从未签到
|
发表于 2014-7-9 09:18:18
|
显示全部楼层
先在Form_Load中记录控件的相对位置及大小比例,然后在Form_Resize中按比例设置控件的位置及大小即可:
Dim ll As Single, tt As Single, ww As Single, hh As Single
Private Sub Form_Load()
ll = Text1.Left / Me.ScaleWidth
tt = Text1.Top / Me.ScaleHeight
ww = Text1.Width / Me.ScaleWidth
hh = Text1.Height / Me.ScaleHeight
End Sub
Private Sub Form_Resize()
Text1.Left = Me.ScaleWidth * ll
Text1.Top = Me.ScaleHeight * tt
Text1.Width = Me.ScaleWidth * ww
Text1.Height = Me.ScaleHeight * hh
End Sub
如果控件比较多的话,就要用数组了。 |
|