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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:58:44+00:00 2026-06-04T06:58:44+00:00

I have written a custom control in C# (inherited from Forms.Control) and it seems

  • 0

I have written a custom control in C# (inherited from Forms.Control) and it seems to working fine, but if you press the button fast enough a problem occurs: only every other click will call the click event handler. This doesn’t happen if you don’t press it fast (less than once a second). The mouseUp and mouseDown handlers always get called no matter how fast you click the button.

Of course doesn’t happen with the canned winform button.

I cannot use the canned button because I’m writing an application for the .net compact framework, so I need a custom control in order to make the UI more presentable. Also, I tested out my code on the full version of the .net framework, and I still have the same problem.

Any help would be greatly appreciated. Thank you!

  • 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-04T06:58:45+00:00Added an answer on June 4, 2026 at 6:58 am

    If you are clicking rapidly enough, you are getting into DoubleClick territory.

    According to above MSDN Page the order of events are:

    The following series of events is raised by the control when such a user action takes place:

    1. MouseDown event.
    2. Click event.
    3. MouseClick event.
    4. MouseUp event.
    5. MouseDown event.
    6. DoubleClick event.
    7. MouseDoubleClick event.
    8. MouseUp event

    If you will notice there is only one Click event per DoubleClick


    For a way to disable it try looking at this MSDN Page discussing ControlStyles.

    From above link:

    StandardClick — If true, the control implements the standard Click behavior.
    StandardDoubleClick — If true, the control implements the standard DoubleClick behavior. This style is ignored if the StandardClick bit is not set to true.

    So try this in your controls constructor or load event:

    this.SetStyle(ControlStyles.StandardClick, true );
    this.SetStyle(ControlStyles.StandardDoubleClick, false);
    

    Since SetStyle does not appear to be in the Compact Framework you could add a DoublClick Event and have it trigger the Click event Programmically like this.

    YourClickEvent(sender, new MouseEventArgs(System.Windows.Forms.MouseButtons.Left,1,0,0,0));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a custom server control which (pseudo-code) looks like public class MyCustomCtrl
I've written a custom ASP.net control that descends from LinkButton and overrides the Render()
I have written a Custom Control that contains the following: [assembly: System.Web.UI.WebResource(InSysControls.AssignmentLists.AssignmentLists.js, text/javascript)] namespace
I have written a user control that contains a text box and a button.
I have written a custom control that renders some graphics. The graphics itself is
I have written a custom Silverlight control based on Control. I have two DependencyProperties
I'm going to have to build a custom control for a WinForms application. But
hey there, i have written a custom control for my App so things get
I have a custom UI control which has a JavaScript class written around the
I have a custom control written in C# that I would like to port

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.