神探狄仁杰前传剧照:VB2005(MSGBOX)使用!
来源:百度文库 编辑:神马品牌网 时间:2024/05/08 06:06:28
我想关闭窗体的右上方的叉就会 出现一个MSGBOX提示,MSGBOX会出现两个按钮(确认)(取消).如果按(确认)窗体就关,按取消(取消).窗体就不关 应该怎么写?
我知道VB6.0是这样写的:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("是否要关闭程序?", vbQuestion + vbOKCancel) = vbCancel Then Cancel = True
End Sub
不过在2005中不能用.请高手指教!!!
先谢!
这位同志说得不是很详细,不明白,不过都谢谢您了.还有没有其他的!
我知道VB6.0是这样写的:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("是否要关闭程序?", vbQuestion + vbOKCancel) = vbCancel Then Cancel = True
End Sub
不过在2005中不能用.请高手指教!!!
先谢!
这位同志说得不是很详细,不明白,不过都谢谢您了.还有没有其他的!
用messagebox.show方法