'状态条:sb,进度条pb,代码放到form_resize方法内即可 With Me '窗体最小宽度高度均为6000,panels(2),你可以把2改为变量传递 If .ScaleHeight < 6000 Then .ScaleHeight = 6000 If .ScaleWidth < 6000 Then .ScaleWidth = 6000 If .Width < 6000 Then .Width = 6000 If .Height < 6000 Then .Height = 6000 pb.Move sb.Panels(2).Left + 60, .ScaleHeight - .sb.Height + 60, .sb.Panels(2).Width - 120, .sb.Height - 120 End With
在MDIFORM中报错Private Sub MDIForm_Resize() On Error GoTo errd '状态条:sb,进度条pb,代码放到form_resize方法内即可 With Me '窗体最小宽度高度均为6000 , Panels(2), 你可以把2改为变量传递 If .ScaleHeight < 6000 Then .ScaleHeight = 6000 If .ScaleWidth < 6000 Then .ScaleWidth = 6000 If .Width < 6000 Then .Width = 6000 If .Height < 6000 Then .Height = 6000 ProgressBar1.Move StatusBar1.Panels(2).Left + 60, .ScaleHeight - .StatusBar1.Height + 60, .StatusBar1.Panels(2).Width - 120, .StatusBar1.Height - 120 End With errd: MsgBox Err.Description End Sub
弱弱的问下,你的exit sub 在哪里
无论加与否,总是以上错,位置在If .ScaleHeight < 6000 Then .ScaleHeight = 6000,我的MDI窗体初始状态为最大化,是不是MDI窗体不支持状态栏上放进度条,我发现我在MDIForm上加进度条时,进度条自动在最上方,且是显示与窗体宽度一样的长度,也不能拉动
'状态条:sb,进度条pb,代码放到form_resize方法内即可
With Me
'窗体最小宽度高度均为6000,panels(2),你可以把2改为变量传递
If .ScaleHeight < 6000 Then .ScaleHeight = 6000
If .ScaleWidth < 6000 Then .ScaleWidth = 6000
If .Width < 6000 Then .Width = 6000
If .Height < 6000 Then .Height = 6000
pb.Move sb.Panels(2).Left + 60, .ScaleHeight - .sb.Height + 60, .sb.Panels(2).Width - 120, .sb.Height - 120
End With
On Error GoTo errd
'状态条:sb,进度条pb,代码放到form_resize方法内即可
With Me
'窗体最小宽度高度均为6000 , Panels(2), 你可以把2改为变量传递
If .ScaleHeight < 6000 Then .ScaleHeight = 6000
If .ScaleWidth < 6000 Then .ScaleWidth = 6000
If .Width < 6000 Then .Width = 6000
If .Height < 6000 Then .Height = 6000
ProgressBar1.Move StatusBar1.Panels(2).Left + 60, .ScaleHeight - .StatusBar1.Height + 60, .StatusBar1.Panels(2).Width - 120, .StatusBar1.Height - 120
End With
errd:
MsgBox Err.Description
End Sub