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 8200405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:26:19+00:00 2026-06-07T06:26:19+00:00

Possible Duplicate: How do you click a button in a webbrowser control in C#?

  • 0

Possible Duplicate:
How do you click a button in a webbrowser control in C#?

I tried just doing it normally, but it kept telling me it needed to be on the other side of a = or +=. How do I fix this?

The code I’m using is:
browser.Document.GetElementById(“ap_h”).Click;

  • 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-06-07T06:26:20+00:00Added an answer on June 7, 2026 at 6:26 am

    The piece of code you are looking for is:

    Invoke a method in the DOM-Element

    // The WebBrowser control
    System.Windows.Forms.WebBrowser webBrowser;
    
    // Perform a click on an element
    HtmlDocument document = webBrowser.Document;
    document.GetElementById("id_of_element").InvokeMember("Click");
    

    The code above performs the click in the WebBrowser Control for you.


    Assign an event handler

    If you want to assign an event handler:

    document.GetElementById("id_of_element").Click 
                                 += new HtmlElementEventHandler(el_Click);
    

    with:

    void el_Click(object sender, HtmlElementEventArgs e)
    {
         // Do something
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: how to call pin annotation on button click in iphone Sorry if
Possible Duplicate: redirect to new page when i click on Cancel button in C#
Possible Duplicate: Call PHP function from jQuery? Jquery on button click call php function
Possible Duplicate: Perform Button click event when user press Enter key in Textbox I
Possible Duplicate: Why in ASP.NET is a button click event executes when page is
Possible Duplicate: change image on click of button in objective c i draged 3
Possible Duplicate: nullpointer exception raises when i click on the button case R.id.Button01check: startActivity(new
Possible Duplicate: Need to cancel click/mouseup events when double-click event detected Preventing double-click of
Possible Duplicate: check whether internet connection is available with C# I just want to
Possible Duplicate: WPF Button isPressed and isEnabled problem Here is a snippet of code

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.