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

  • Home
  • SEARCH
  • 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 6760119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:01:47+00:00 2026-05-26T14:01:47+00:00

There is a page loaded in a webBrowser1 object. It has a button tag,

  • 0

There is a page loaded in a webBrowser1 object. It has a “button” tag, which is the button that I need to click. It’s basic button. No JavaScript, etc.

I tried:

1) to click it with “enter”:

webBrowser.Document.GetElementsByTagName("button")[0].Focus();
Sendkeys.Sendwait("{ENTER}");

That didn’t work.

2) to call the “click” event:

webBrowser.Document.GetElementsByTagName("button")[0].InvokeMember("click");

That also didn’t work because it’s not JavaScript.

3) the “click” handler:

webBrowser.Document.GetElementsByTagName("button")[0].Click +=
        new System.EventHandler(button_click1);

This also can not work, because from what I’ve read, this is an event handler which triggers after the user actually clicks on this button.

So I ran out of options. What else can I try?

  • 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-26T14:01:48+00:00Added an answer on May 26, 2026 at 2:01 pm

    you can try like this for capturing the button event in web browser using c#

    HtmlElement el = webBrowser1.Document.All["mybutton"];
    object obj = el.DomElement;
    System.Reflection.MethodInfo mi = obj.GetType().GetMethod("click");
    mi.Invoke(obj, new object[0]); 
    

    OR

    private void Form1_Load(object sender, EventArgs e)
    {
       this.wb.Url = new Uri("https://login.yahoo.com/config/login_verify2?.intl=gr&.src=ym");
       this.wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
    }
    public void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        HtmlElement username = this.wb.Document.All["username"];
        username.SetAttribute("value", "kataras2012@yahoo.gr");
        HtmlElement pass = this.wb.Document.All["passwd"];
        pass.SetAttribute("value", "passTest");
        HtmlElement goButton = this.wb.Document.All[".save"];
        goButton.InvokeMember("click");
    
        return;
    }
    

    i hope it will helps you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there anyway to unload a page that has been loaded inside an iframe?
hey there, i have a div that expands when the page is loaded, now
There's placeholder on the page that is loaded asynchronously using jQuery load method. Page
Is there a way to include a javascript-loaded advertisement last on the page, but
Is there a way to ask JavaScript what web page is currently loaded? Example:
We need to block all requests inside a page loaded in an IFRAME tag.
On this page there is a list of footer links that have a little
On the page there are links displayed with CSS as buttons: HTML: <a class=button
I have a page that has multiple select lists and when ever one of
is there a way to know that the WebBrowser control has finished loading the

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.