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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:45:41+00:00 2026-05-13T13:45:41+00:00

When I create buttons in C#, it creates private void button_Click(object sender, EventArgs e)

  • 0

When I create buttons in C#, it creates private void button_Click(object sender, EventArgs e) method as well.

How do I call button1_click method from button2_click?
Is it possible?

I am working with Windows Forms.

  • 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-13T13:45:42+00:00Added an answer on May 13, 2026 at 1:45 pm
    // No "sender" or event args
    public void button2_click(object sender, EventArgs e)
    {
       button1_click(null, null);
    }
    

    or

    // Button2's the sender and event args
    public void button2_click(object sender, EventArgs e)
    {   
       button1_click(sender, e);
    }
    

    or as Joel pointed out:

    // Button1's the sender and Button2's event args
    public void button2_click(object sender, EventArgs e)
    {   
       button1_click(this.button1, e);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

private void LoginButton_Click(object sender, EventArgs e) { try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(loginUrl); IAsyncResult
I was wondering about the following: private void RandomEventHandler_Click(object sender, EventArgs e) { //
I have event Button that creates text box in run time. Private Sub Button1_Click(ByVal
I want to create a method in code behind that creates a button and
I am trying to create buttons that play single sound files and one button
I'm trying to dynamically create buttons at runtime with PyQT4.7 However, this being my
Here is my piece of code that creates buttons programmatically: NSArray *buttonImage=[NSArray arrayWithObjects:[UIImage imageNamed:@Cover_0.png],
So I was digging around to get some ideas on how to create buttons
I create some buttons dynamically on my view and i decide their frames according
I try to create 2 buttons inside my app case WM_CREATE:{ hWnd =CreateWindowEx(NULL, LBUTTON,

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.