如何让VB窗体里的关闭按钮(X)失效,或在一定时间内无效?
如何让VB窗体里的关闭按钮(X)失效,或在一定时间内无效?不必和我讲原理教我怎么弄就OK了谢谢发到我邮箱,并注明你的百度名称zhangdongshan0612@163.c...
如何让VB窗体里的关闭按钮(X)失效,或在一定时间内无效?
不必和我讲原理
教我怎么弄就OK了
谢谢
发到我邮箱,并注明你的百度名称
zhangdongshan0612@163.com 展开
不必和我讲原理
教我怎么弄就OK了
谢谢
发到我邮箱,并注明你的百度名称
zhangdongshan0612@163.com 展开
1个回答
展开全部
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As String) As Long
将上述代码写在“通用”块内,之后将Form_Load()事件代码改写如下即可(两种方法都可以)
Private Sub Form_Load()
ModifyMenu GetSystemMenu(Me.hWnd, 0), &HF060&, 3, 0, "禁止关闭"
End Sub
或者
Private Sub Form_Load()
DeleteMenu GetSystemMenu(Me.hWnd, 0), &HF060&, 0
End Sub
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As String) As Long
将上述代码写在“通用”块内,之后将Form_Load()事件代码改写如下即可(两种方法都可以)
Private Sub Form_Load()
ModifyMenu GetSystemMenu(Me.hWnd, 0), &HF060&, 3, 0, "禁止关闭"
End Sub
或者
Private Sub Form_Load()
DeleteMenu GetSystemMenu(Me.hWnd, 0), &HF060&, 0
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询