Close on Awesomium Url.ToString.Contains

alguembr

Newbie
Joined
Jan 24, 2015
Messages
3
Reaction score
1
Hello, I'm in trouble here
How can I close my form with this command in awesomium?



Code:
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If WebBrowser1.Url.ToString.Contains("ok") Then
            Form2.Show()
            Me.Close()
        End If
    End Sub
 
protected override void OnClosed( EventArgs e )
{
base.OnClosed( e );

// Destroy the WebControl and its underlying view.
webControl.Dispose();
}

Hope this helps.
 
Hope this helps.

OP is looking for a way to detect if the html document of awesomium contain specific element. Not to close it.

Code:
Dim thecode As String = WebControl1.ExecuteJavascriptWithResult("document.getElementsByTagName('html')[0].innerHTML")
If thecode.contains("ok") Then
Form2.show
Me.Close
End if
 
Last edited:
Back
Top