Re: Multi-Threading Made EZ
hey, nice tutorial thx, i'm trying to make a form pause till a page is loaded within the webbrowser control on the form , can u tell me how do i use threading for that ?
Re: Multi-Threading Made EZ
I could be wrong, or I could be reading your question wrong, but I'm sure there is an event for something like that. What you could then do is have a "starter" method for your elongated code & have it fire off when the page is loaded. I don't have vs open, so again, not sure the event is there, but i'm 99% positive it is.
It should probably look something like:
vb Code:
' to simplify, this is whatever method you want it to be
Private Sub ThisIsYourStartUpMethod(ByVal PassedValueIfNeeded As Object)
Try
Select Case PassedValueIfNeeded
Case "Hysteria"
If WebBrowser1.Focused Then Me.Close() Else WebBrowser1.Focus()
Case Else
Throw New Exception
End Select
Catch ex As Exception
Dim bob As String = ex.StackTrace.Substring(ex.StackTrace.Length - 8)
MsgBox(bob & Environment.NewLine & ex.Message)
End Try
End Sub
' This is the important part as this is the even you need to look for, i believe asp browser controls have somthing similar as well, but i dont do alota browser stuff
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As Whatever.TheSystem.Argument.IsForThis.Control) Handles WebBrowser1.DocumentCompleted
ThisIsYourStartUpMethod(sender)
End Sub
Re: Multi-Threading Made EZ
On an added note, you might check This nice tut by zeidhaddadin here on the forums!