Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Visual Basic 2008 Tutorial - Background Worker

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
5,718
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 30, 2009

Im gonna show you what a Backgroundworker does and can do(just a simple test)
Subscribe, Comment, Rate :)
thaaaaanks
www.nibic.ucoz.com


CODES:

dim i as integer


Dowork:
do untill i = "100"
if backgroundwork1.cancellationPending = true then
Exit sub
end if
i = i + 1
backgroundworker1.reportProgress(0)
systemthreading.Thread.sleep(1)

StartBtn Click:
backgroundworker1.runworkerasync()
timer1.start

StopBTn Click:
backgroundworker1.cancelasync()
timer1.stop

Timer1.tick
label1.text = i
progressbar1.value = i



tinlukasas made some codes that i added too. Ty :) :
Backgroundworker_dowork codes:
Do Until i = 100

i += 1

Invoke(New ReportNum(AddressOf NumToLabel), i)



Make a new sub:
Sub NumToLabel(ByVal num As Integer)

Label1.Text = num.ToString()

ProgressBar1.Value = num

EndSub

Category:

Howto & Style

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:

Uploader Comments (TeamNiBiC)

  • BackgroundWorker_DoWork

    Do Until i = 100

    i += 1

    Invoke(New ReportNum(AddressOf NumToLabel), i)

    ...

    ...

  • @tenlukasas :) ye.. can i add that code to Desc?.. ill give you Credits

  • @TeamNiBiC ye, you can

  • @tenlukasas Thanks so much :)!

see all

All Comments (27)

Sign In or Sign Up now to post a comment!
  • Dude you are a n00b .. just adding "label1.text = i.ToString" would of fixed the problem :)) what an EPIC FAIL..... =))))) LMAO

  • Sub NumToLabel(ByVal num As Integer)

    Label1.Text = num.ToString()

    ProgressBar1.Value = num

    EndSub

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more