以下是引用mxg825在2007-12-26 12:17:14的发言:谢谢!窗体全屏了! 但里面的其他控件无法,按比例也放大! 正好看过狼版写过的一个贴子。 Dim pos As New Collection dim ctl As Control dim lng as new collection Private Sub UserForm_Initialize() For Each ctl In Me.Controls pos.Add ctl.Left / Me.Width & " " & ctl.Top / Me.Height, ctl.Name lng.Add ctl.Width / Me.Width & " " & ctl.Height / Me.Height, ctl.Name Next
Application.WindowState = xlMaximized UserForm1.Width = Application.Width UserForm1.Height = Application.Height For Each ctl In Me.Controls ctl.Left = Me.Width * Val(Split(pos(ctl.Name))(0)) ctl.Top = Me.Height * Val(Split(pos(ctl.Name))(1)) ctl.Width = Me.Width * Val(Split(lng(ctl.Name))(0)) ctl.Height= Me.Height * Val(Split(lng(ctl.Name))(1)) Next
End Sub
[此贴子已经被作者于2007-12-26 13:37:23编辑过] |