1. On Saturday September 3RD, 2016 this community will be shutdown permanently.

    The time has come to close this community. I no longer have any interest in Visual Studio programming and my efforts to find someone to take over the community has failed.

    If anyone is interested in acquiring the database contact me and I will make it available for you.

VB.Net Display MsgBox but continue application

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

  1. DN Admin

    DN Admin Administrator
    Staff Member

    Country:
    United States
    Joined:
    Aug 7, 2010
    Messages:
    12,048
    Likes Received:
    258
    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