请教VB高手resize的问题
窗体变时,里面的控件大小也变,编了程序在主窗体实现了,但相同的程序在别的窗体就不行,这是怎么回事呢?...
窗体变时,里面的控件大小也变,编了程序在主窗体实现了,但相同的程序在别的窗体就不行,这是怎么回事呢?
展开
展开全部
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.Height = TH
'设置Text1的位置和大小
List1.Top = LT
List1.Left = LL
List1.Width = LW
List1.Height = LH
'设置List1的位置和大小
Combo1.Top = CT
Combo1.Left = CL
Combo1.Width = CW
' Combo1.Height = CH
'设置Combo1的位置和大小
Command1.Top = CMT
Command1.Left = CML
Command1.Width = CMW
Command1.Height = CMH
'设置Command1的位置和大小
End Sub
看不明白再问我
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.Height = TH
'设置Text1的位置和大小
List1.Top = LT
List1.Left = LL
List1.Width = LW
List1.Height = LH
'设置List1的位置和大小
Combo1.Top = CT
Combo1.Left = CL
Combo1.Width = CW
' Combo1.Height = CH
'设置Combo1的位置和大小
Command1.Top = CMT
Command1.Left = CML
Command1.Width = CMW
Command1.Height = CMH
'设置Command1的位置和大小
End Sub
看不明白再问我
展开全部
Private Sub Form_Resize()
Text1.Width = Me.Width/2
Text1.Height = Me.Height/2
Text1.Left = Me.width - Text1.Width
Text1.Top = Me.Height-Text1.Height
End Sub
要充分利用Me.Height 还有 Me.Width。
还有 你得Resize错误可能是你把ScalMode设置成非1的了 这样改变很小.或者很大
值1:VB默认单位
值3:象素。
Text1.Width = Me.Width/2
Text1.Height = Me.Height/2
Text1.Left = Me.width - Text1.Width
Text1.Top = Me.Height-Text1.Height
End Sub
要充分利用Me.Height 还有 Me.Width。
还有 你得Resize错误可能是你把ScalMode设置成非1的了 这样改变很小.或者很大
值1:VB默认单位
值3:象素。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询