1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Close on Awesomium Url.ToString.Contains

Discussion in 'Visual Basic .NET' started by alguembr, Jan 31, 2015.

  1. alguembr

    alguembr Newbie

    Joined:
    Jan 24, 2015
    Messages:
    3
    Likes Received:
    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
    
    
     
  2. mohamedraouf

    mohamedraouf Junior Member

    Joined:
    Sep 16, 2014
    Messages:
    122
    Likes Received:
    10
    I suppose you want to close the main form ?
     
  3. alguembr

    alguembr Newbie

    Joined:
    Jan 24, 2015
    Messages:
    3
    Likes Received:
    1
    yes but i need this for awesomium
     
  4. stevie

    stevie Newbie

    Joined:
    Jul 31, 2010
    Messages:
    49
    Likes Received:
    10
    Location:
    UK
    Home Page:
    Hope this helps.
     
  5. Netro

    Netro Junior Member

    Joined:
    Jun 12, 2015
    Messages:
    107
    Likes Received:
    27
    Occupation:
    Baka Dev.
    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: May 1, 2016