简体   繁体   中英

Visual Basic msgbox spam error

In my program I have a progress bar that when it completes it displays a message, the problem is that when the message box is displayed it spams the msgboxes. here is my code

If ProgressBar1.Value = ProgressBar1.Maximum Then
        MsgBox("Done")
        Timer1.Stop()
        ProgressBar1.Value = 0
    End If

If I could get an answer to make the messages stop spamming that would be great!

I think msgbox will stop the ui thread but not the timer thread, put the timer1.stop() before the msgbox

i just did a quick test and it is in fact true.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM