使窗体上的关闭按钮失效

类别:.NET开发 点击:0 评论:0 推荐:

Const vbFormControlMenu=0 'User has chosen Close command from Control menu box on form
Const vbFormCode=1             'Unload method invoked from code
Const vbAppWindows=2        'Current Windows session ending
Const vbAppTaskManager=3  'Windows Task Manger is closing the application
Const vbFormMDIForm=4      'MDI child form is closing because the MDI form is closing
vbFormOwner=5                     'The owner of the form is closing


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
   Cancel = True
End If
End Sub

本文地址:http://com.8s8s.com/it/it42885.htm