推荐于2016-11-11
展开全部
准备工作新建一个窗体窗体上建一个按钮新建一个模块窗体代码为Private Sub CommandButton1_Click()
UserForm1.Hide
End SubPrivate Sub UserForm_Click()
aa = FindWindow("ThunderDFrame", Me.Caption)
bb = GetWindowLong(aa, GWL_STYLE)
bb = bb And Not WS_CAPTION
SetWindowLong aa, GWL_STYLE, bb
DrawMenuBar aa
Me.Width = Application.Width + 5
Me.Height = Application.Height + 5
Me.Top = 0
Me.Left = 0
End Sub模块代码为Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Public Const GWL_STYLE As Long = (-16)
Public Const WS_CAPTION As Long = &HC00000
窗体单击达到你的要求按钮单击窗体退出
UserForm1.Hide
End SubPrivate Sub UserForm_Click()
aa = FindWindow("ThunderDFrame", Me.Caption)
bb = GetWindowLong(aa, GWL_STYLE)
bb = bb And Not WS_CAPTION
SetWindowLong aa, GWL_STYLE, bb
DrawMenuBar aa
Me.Width = Application.Width + 5
Me.Height = Application.Height + 5
Me.Top = 0
Me.Left = 0
End Sub模块代码为Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Public Const GWL_STYLE As Long = (-16)
Public Const WS_CAPTION As Long = &HC00000
窗体单击达到你的要求按钮单击窗体退出
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询