'添加一个 Check1 当它打勾时容许一切的变化, 没打勾则一切变化都会还原为初始的窗体尺寸Dim OldWidth&, OldHeight&Private Sub Form_Load() OldWidth = Me.Width: OldHeight = Me.Height End SubPrivate Sub Form_Resize() If Check1.Value = 0 Then Me.WindowState = 0 If Me.Width <> OldWidth Then Me.Width = OldWidth If Me.Height <> OldHeight Then Me.Height = OldHeight End If End SubPrivate Sub Check1_Click() Form_Resize End Sub
If Me.WindowState = vbMaximized Then Me.WindowState = vbNormal
End Sub
呵呵 服了你~~想的满周到~~属性设定为 FixedDialog, MinButton=TRUE, MaxButton=Fasle
基本上解决了吧
= =
OldWidth = Me.Width: OldHeight = Me.Height
End SubPrivate Sub Form_Resize()
If Check1.Value = 0 Then
Me.WindowState = 0
If Me.Width <> OldWidth Then Me.Width = OldWidth
If Me.Height <> OldHeight Then Me.Height = OldHeight
End If
End SubPrivate Sub Check1_Click()
Form_Resize
End Sub