Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3989378
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:21:58+00:00 2026-05-20T06:21:58+00:00

am trying to convert this c# to vb.net that has a webbrowser control, but

  • 0

am trying to convert this c# to vb.net that has a webbrowser control, but am confused. the code is in a usercontrol.

c#

 private void SetupEvents()
    {
        webBrowser1.Navigated += new WebBrowserNavigatedEventHandler(webBrowser1_Navigated);
        webBrowser1.GotFocus += new EventHandler(webBrowser1_GotFocus);
    }

 [Browsable(true)]
    public override Color BackColor
    {
        get
        {
            return base.BackColor;
        }
        set
        {
            base.BackColor = value;
            if (ReadyState == ReadyState.Complete)
            {
                SetBackgroundColor(value);
            }
        }
    }



public HtmlDocument Document
        {
            get { return webBrowser1.Document; }
        }

the error
‘Public Event Navigated(sender As Object, e As System.Windows.Forms.WebBrowserNavigatedEventArgs)’ is an event, and cannot be called directly. Use a ‘RaiseEvent’ statement to raise an event.

please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:21:59+00:00Added an answer on May 20, 2026 at 6:21 am

    try this code:

    Private Sub SetupEvents()
        AddHandler webBrowser1.Navigated, AddressOf Me.webBrowser1_Navigated
        AddHandler webBrowser1.GotFocus, AddressOf Me.webBrowser1_GotFocus
    End Sub    
    <Browsable(true)>  _
    Public Overrides Property BackColor As Color
        Get
            Return MyBase.BackColor
        End Get
        Set
            MyBase.BackColor = value
            If (ReadyState = ReadyState.Complete) Then
                SetBackgroundColor(value)
            End If
        End Set
    End Property
    
    Public ReadOnly Property Document As HtmlDocument
        Get
            Return webBrowser1.Document
        End Get
    End Property
    
    Private Sub SetupEvents()
        AddHandler webBrowser1.Navigated, AddressOf Me.webBrowser1_Navigated
        AddHandler webBrowser1.GotFocus, AddressOf Me.webBrowser1_GotFocus
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code i'm trying to convert from C# to VB.net: public object
I'm trying to convert some code that worked great in VB, but I can't
Question: I'm trying out to convert this here: http://support.microsoft.com/kb/828736 to VB.net I got it
Trying to convert this c code into MIPS and run it in SPIM. int
I am using this code for on android just trying to convert string to
This is a but of a part 2 in trying to convert an SVN
I'm trying to convert this VB.NET / C# declaration into a Visual Basic 6.0
I have a Solution that has two class libraries. I'm trying to convert the
I have some C# code I'm trying to convert to VB.NET. There are some
I am trying to convert code that contains the \ operator from Matlab (Octave)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.