0

I am looking for a way to detect if a button was pressed in C#. For example:

    private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)        {

       if (button1Clicked == true)
       {
          MessageBox.Show("Button 1 was clicked"); 
       }
    }

Thank you for looking.

3
  • Could you elaborate a bit more. Whats your program in? browser, java, desktop,.... Commented Apr 2, 2012 at 12:41
  • Revised - I knew I forgot to state something. Commented Apr 2, 2012 at 12:48
  • e.ClickedElement or something? Commented Apr 2, 2012 at 12:52

1 Answer 1

1

You may just use a static variable and change the state of this static variable and check it. For instance;

public static bool button1Clicked;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.