vb中弹出消息框如何能不中断程序的运行
答案:4 悬赏:0 手机版
解决时间 2021-03-09 18:05
- 提问者网友:蔚蓝的太阳
- 2021-03-09 12:26
用msgbox会中断程序的继续运行,用什么方法可以在弹出消息框之后,程序还能继续运行呢?谢谢
最佳答案
- 五星知识达人网友:执傲
- 2021-03-09 13:42
用MessageBox代替MsgBox
Private Declare Function MessageBox Lib "user32.dll" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Private Sub Command1_Click()
Timer1.Interval = 1000
MessageBox hwnd, "消息文本", "标题", 64
End Sub
Private Sub Timer1_Timer()
Cls
Print Now
Print "时间还在走"
End Sub
Private Sub Command2_Click()
MsgBox "现在再看呢", 64, "还走吗"
End Sub
Private Declare Function MessageBox Lib "user32.dll" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Private Sub Command1_Click()
Timer1.Interval = 1000
MessageBox hwnd, "消息文本", "标题", 64
End Sub
Private Sub Timer1_Timer()
Cls
Print Now
Print "时间还在走"
End Sub
Private Sub Command2_Click()
MsgBox "现在再看呢", 64, "还走吗"
End Sub
全部回答
- 1楼网友:罪歌
- 2021-03-09 16:24
Private Sub Command1_Click()
Dim A As Integer
A = MsgBox("提示", vbOKCancel, "标题")
If A = 1 Then
'程序运行的代码
Else
'结束程序的代码
End If
End Sub
- 2楼网友:一把行者刀
- 2021-03-09 15:44
用窗体做成msgbox样子的框,功能做一样的就不会影响了
- 3楼网友:怀裏藏嬌
- 2021-03-09 15:22
你好!
Private Sub Command1_Click()
Dim A As Integer
A = MsgBox("提示", vbOKCancel, "标题")
If A = 1 Then
'程序运行的代码
Else
'结束程序的代码
End If
End Sub
我的回答你还满意吗~~
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯