请教一个VB中resize的问题

来源:百度知道 编辑:UC知道 时间:2024/05/27 21:42:49
我想让窗体里的控件随窗体大小改变而改变,我编了个整体程序,开始还行,但在窗体里加入菜单之后就不行了,请问菜单不算控件吧,它有什么特殊性吗?

Dim TT, TL, TW, TH As Single
Dim CT, CL, CW, CH As Single
Dim LT, LL, LW, LH As Single
Dim CMT, CML, CMW, CMH As Single
Private Sub Form_Load()
TT = Text1.Top
TL = Text1.Left
TW = Text1.Width
TH = Text1.Height
'保存Text1控件的Top、Left、Width和Height属性
CT = Combo1.Top
CL = Combo1.Left
CW = Combo1.Width
CH = Combo1.Height
'保存Combo1控件的Top、Left、Width和Height属性
LT = List1.Top
LL = List1.Left
LW = List1.Width
LH = List1.Height
'保存List1控件的Top、Left、Width和Height属性
CMT = Command1.Top
CML = Command1.Left
CMW = Command1.Width
CMH = Command1.Height
'保存Command1控件的Top、Left、Width和Height属性
End Sub

Private Sub Form_Resize()
Form1.ScaleHeight = 1000
Form1.ScaleWidth = 1000
Text1.Top = TT
Text1.Left = TL
Text1.Width = TW
Text1.He