'Navigate' is not a member of 'WebView22' ?

vmars316 621 Reputation points
2020-09-26T00:22:20.55+00:00

Hello & Thanks ;

Trying to convert my SafeBrowser WebBrowser1 to WebView22
& getting error:
1>C:\Users\vmars\source\repos\WindowsApp2_01\Form1.vb(7,9): error BC30456: 'Navigate' is not a member of 'SafeBrowser'.

Which brings up the question How do I turn all this
Private Sub SafeBrowser_Load(sender As Object, e As EventArgs) Handles MyBase.Load

into this
Private Sub WebView22_Click(sender As Object, e As EventArgs) Handles WebView22.Click
End Sub

Private Sub SafeBrowser_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    '        Me.Navigate("http://vmars.us/SafeBrowser/SafeBrowserHome.html")

End Sub

 Sub SafeBrowser_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        WebBrowser1.ScriptErrorsSuppressed = True
        WebBrowser1.IsWebBrowserContextMenuEnabled = False
        Me.StartPosition = FormStartPosition.CenterScreen
        Me.Left = 40
        Me.Top = 20
        Me.Height = 600
        Me.Width = 1180
        WebBrowser1.Height = Me.Height - 100
        WebBrowser1.Width = Me.Width - 50
        WebBrowser1.Navigate("http://vmars.us/SafeBrowser/SafeBrowserHome.html")
        '        WebBrowser1.Navigate("file:///C:/SafeBrowser/kidzSearch.com.html")
        '        WebBrowser1.Navigate("file:///C:/SafeBrowser/HtmlTags-WithinTags-09-19-2020-15.48.34.html")

        ThisLinkOk() ' read & load list
        ThisSiteOk() ' read & load list
    End Sub


    Private Sub WebView22_Click(sender As Object, e As EventArgs) Handles WebView22.Click
    End Sub

    Private Sub SafeBrowser_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        '        Me.Navigate("http://vmars.us/SafeBrowser/SafeBrowserHome.html")

    End Sub

Thanks for your Help...

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,898 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,626 Reputation points
    2020-09-28T05:19:31.097+00:00

    Hi Vernon Marsden,
    Does your 'WebView22' refer to WebView2 control?
    If so, have you add this control to your project?
    If you want to use WebView2 in winforms, please follow this document to create a WebView2 control.
    And ensure you installed the following list of pre-requisites before adding WebView2 control:

    1. Microsoft Edge (Chromium) Canary channel installed on Windows 10, Windows 8.1, or Windows 7.
    2. Visual Studio 2017 or later.
      Note that you need to use webView2.CoreWebView2.Navigate(url) to navigate the WebView2 to the URL.
      Best Regards,
      Daniel Zhang

    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.