Jump to content

VB.Net Display MsgBox but continue application

- - - - -

  • Please log in to reply
No replies to this topic

#1
AWS

AWS

    Administrator

  • Administrators
  • 54,078 posts
  • LocationJoliet, IL U.S.A.

I have this For Next Loop with a Delay that runs but it stops running till I hit OK on the MsgBox.  what is the best way to do a task x times with x delay but not wait for MsgBox.   

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim var As Integer
        Dim startVal As Integer
        Dim endVal As Integer
        startVal = 1
        endVal = 5
        For var = startVal To endVal
            System.Threading.Thread.Sleep(2000)
            MsgBox("Message Box Shows " & var & " Times ")
        Next var
    End Sub

View the full article




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users