VB.Net Display MsgBox but continue application

Discussion in 'Visual Basic .Net' started by DN Admin, Apr 12, 2012.

  1. DN Admin

    Staff Member

    Country:
    United States
    Joined:
    Aug 7, 2010
    Likes Received:
    258
    Trophy Points:
    45
    Location:
    Joliet, 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.

    <pre class="prettyprint lang-vb <span class="kwd Private<span class="pln <span class="kwd Sub<span class="pln Button2_Click<span class="pun (<span class="kwd ByVal<span class="pln sender <span class="kwd As<span class="pln System<span class="pun .<span class="kwd Object<span class="pun ,<span class="pln <span class="kwd ByVal<span class="pln e <span class="kwd As<span class="pln System<span class="pun .<span class="pln EventArgs<span class="pun )<span class="pln <span class="kwd Handles<span class="pln Button2<span class="pun .<span class="pln Click
    <span class="kwd Dim<span class="pln var <span class="kwd As<span class="pln <span class="kwd Integer<span class="pln
    <span class="kwd Dim<span class="pln startVal <span class="kwd As<span class="pln <span class="kwd Integer<span class="pln
    <span class="kwd Dim<span class="pln endVal <span class="kwd As<span class="pln <span class="kwd Integer<span class="pln
    startVal <span class="pun =<span class="pln <span class="lit 1<span class="pln
    endVal <span class="pun =<span class="pln <span class="lit 5<span class="pln
    <span class="kwd For<span class="pln var <span class="pun =<span class="pln startVal <span class="kwd To<span class="pln endVal
    System<span class="pun .<span class="pln Threading<span class="pun .<span class="pln Thread<span class="pun .<span class="pln Sleep<span class="pun (<span class="lit 2000<span class="pun )<span class="pln
    MsgBox<span class="pun (<span class="str "Message Box Shows "<span class="pln <span class="pun &<span class="pln var <span class="pun &<span class="pln <span class="str " Times "<span class="pun )<span class="pln
    <span class="kwd Next<span class="pln var
    <span class="kwd End<span class="pln <span class="kwd Sub</pre>

    View the full article
     

Share This Page