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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:51:13+00:00 2026-06-17T07:51:13+00:00

I have a problem with probably a simple solution, but I just dont get

  • 0

I have a problem with probably a simple solution, but I just dont get it right.
So I want something to happen if I press the left mouse button.

private void DrawingPanel_MouseClick(object sender, MouseEventArgs e)
{  
  if (e.Button == MouseButtons.Left)
  {
   //something happens
  }
}

So, that works fine. but now the problem comes inn. Now I want to check for more clicks within the click event (now that I think about it, is that even possible?)
Something like this:

private void DrawingPanel_MouseClick(object sender, MouseEventArgs e)
{  
  if (e.Button == MouseButtons.Left)
  {
   //something happens
   //blabla...
   if (e.Button == MouseButtons.Left)
   {
    //Do something
   }
  }
}

Is something like that possible? Because the second if (e.Button == MouseButtons.Left) is always true.
How can I do it so that its not automaticlly true?

  • 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-17T07:51:15+00:00Added an answer on June 17, 2026 at 7:51 am

    This won’t work out the way you implemented it, because within that handler you still handle the one mouse-click event.

    Try handling the Control.DoubleClick-event instead.

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

Sidebar

Related Questions

Probably something simple, but heres my problem, I have implememnted a simple captcha into
Probably a trivial question, but I want to get the best possible solution. Problem:
I have a simple problem which probably has a simple solution, but the solution
I have a strange problem which probably has a very simple solution, I just
well i have most probably an extremly stupid problem but could not figure it
I have a problem that I tried to ask about previously, but didn't get
I have a little problem, probably easy for you. Im using Core Data. I
I got a probably small problem using memcmp. I have two arrays (length =
Probably a very trivial problem. I have an object that looks like this: @PersistenceCapable
I have been having the following problem, i think it's probably due to 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.