开发者

Prevent closing of a form

开发者 https://www.devze.com 2022-12-08 18:23 出处:网络
How can i avoid closing a form if by mistake cross is开发者_如何学Go clickedHandle this in the Form\'s QueryUnload event.There\'s an UnloadMode parameter and a Cancel Parameter:

How can i avoid closing a form if by mistake cross is开发者_如何学Go clicked


Handle this in the Form's QueryUnload event. There's an UnloadMode parameter and a Cancel Parameter:

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    If UnloadMode = vbFormControlMenu Then Cancel = True

End Sub

For more info on the QueryUnload event, see the MSDN VB6 Language Reference or check out this article.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号