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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:25:58+00:00 2026-05-24T22:25:58+00:00

Here is the short sample code: private void txtbox1_DoubleClick(object sender, EventArgs e) { button1_Click(object

  • 0

Here is the short sample code:

private void txtbox1_DoubleClick(object sender, EventArgs e)
{
    button1_Click(object sender, EventArgs e); //can I call button1 event handler?
}

private void button1_Click(object sender, EventArgs e)
{
    MessageBox.Show(txtbox1.Text);
}

I wonder if it would be okay to code in the above way?

  • 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-24T22:25:59+00:00Added an answer on May 24, 2026 at 10:25 pm

    You can do that – although the code you provide can’t be compiled. It should look like this:

    private void txtbox1_DoubleClick(object sender, EventArgs e)
    {
        button1_Click(sender, e);
    }
    
    private void button1_Click(object sender, EventArgs e)
    {
        MessageBox.Show(txtbox1.Text);
    }
    

    But for best practice and code readability, you’re probably better off doing this, especially as you are not making use of sender and e:

    private void txtbox1_DoubleClick(object sender, EventArgs e)
    {
        ShowMessageBox();
    }
    
    private void button1_Click(object sender, EventArgs e)
    {
        ShowMessageBox();
    }
    
    private void ShowMessageBox()
    {
        MessageBox.Show(txtbox1.Text);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my short implementation of Russian Peasant Multiplication . How can it be
So here's a snippet of my code: struct dv_nexthop_cost_pair { unsigned short nexthop; unsigned
I am currently having trouble with the following (here is some sample code first):
Here's a short test program: sub foo($;@) { my $sql = shift; my @params
I have a SVNSERVE server set up to host multiple repositories. Short question here
First question here: it is a very short yet fundamental thing in Java that
Here's the following algorithm: int encryption(int a, int b) { short int c, c2;
Short question - how do you define your view models? Here are some of
All, In Apple's sample code DateCell http://developer.apple.com/library/ios/#samplecode/DateCell/Introduction/Intro.html the ivar pickerView is declared in MyTableViewController.h
I'm kind of stuck with my heap sort here in php: <?php function heapSort($a,

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.