vBA中怎么隐藏窗体关闭按钮??

我想在窗体运行的时候,没有关闭那个叉按钮,而且填满我电脑窗体的怎么设置啊... 我想在窗体运行的时候,没有关闭那个叉按钮,而且填满我电脑窗体的怎么设置啊 展开
 我来答
匿名用户
推荐于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
窗体单击达到你的要求按钮单击窗体退出
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式