5个回答
推荐于2017-11-26
展开全部
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = True
End Sub 这个可以一试,不过世界上没有绝对的事。
Cancel = True
End Sub 这个可以一试,不过世界上没有绝对的事。
2014-01-10
展开全部
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_REMOVE = &H1000
Private Const SC_CLOSE = &HF060
Function Disabled(ChWnd As Long)
Dim hMenu, hendMenu As Long
Dim c As Long
hMenu = GetSystemMenu(ChWnd, 0)
RemoveMenu hMenu, SC_CLOSE, MF_REMOVE
End Function
'然后在Sub Form_Load()中加入Disabled Me.hwnd即可:
Private Sub Form_Load()
Disabled Me.hwnd
End Sub
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_REMOVE = &H1000
Private Const SC_CLOSE = &HF060
Function Disabled(ChWnd As Long)
Dim hMenu, hendMenu As Long
Dim c As Long
hMenu = GetSystemMenu(ChWnd, 0)
RemoveMenu hMenu, SC_CLOSE, MF_REMOVE
End Function
'然后在Sub Form_Load()中加入Disabled Me.hwnd即可:
Private Sub Form_Load()
Disabled Me.hwnd
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-01-10
展开全部
用下面的代码就可以,虽然窗体上有关闭按钮,但就是不能关闭Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = True
End Sub
Cancel = True
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
看我来个更有意思的😄
Private Sub Form_Unload(Cancel As Integer)
myexit = MsgBox("看完才能退出哦", vbExclamation + vbYesNo + vbDefaultButton, "哼...")
Cancel = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
myexit = MsgBox("看完才能退出哦", vbExclamation + vbYesNo + vbDefaultButton, "哼...")
Cancel = True
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-01-10
展开全部
form1.Enabled=false但整个窗体都没反应了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询