Background threads and UIThread Components

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DevInCode
    New Member
    • Apr 2008
    • 55

    Background threads and UIThread Components

    I'm looking for some help or suggestions about something I'm working
    on. I'm using the webbrowser control in VB.net. I want to click a
    button and have the webbrowser go to a certain website (done). Then I
    want it to wait a period of time and then do something on the page its
    on. The part I'm having a problem with is the waiting period. in the
    main form I have no problem manipulating controls or anything like
    that.

    One solution would be to use thread.sleep() but that locks the ui and
    I don't like that.

    What I am trying to do is have a backgroundworke r do the waiting then
    perform the necessary actions on the webpage, but the backgroundworke r
    isn't able to access that thread, makes sense. What I can't figure
    out is how to get around this. I've explored delegates but that
    doesn't seem to do what I want as it doesn't allow me to put the
    background thread to sleep BEFORE it does its work.

    Suggestions? Good tutorials?

    Thanks!
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    What is your backgroundworke r supposed to wait for?
    Is it waiting for something to happen?
    Why are you waiting?

    Comment

    • DevInCode
      New Member
      • Apr 2008
      • 55

      #3
      I'm waiting for 5-10 minutes, then directing my browser to a link on the page. So I'm not waiting for a particular event to occur, per se.

      also, thank you for the speedy response.

      Comment

      Working...