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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:40:13+00:00 2026-05-29T09:40:13+00:00

I have a few checkboxes representing people. Something like this: [ ] George [

  • 0

I have a few checkboxes representing people. Something like this:

[ ] George
[ ] Sam
[ ] Steve
[ ] Lisa

Each can be checked individually, and of course it’s also possible to check none at all. Code runs upon a change in check state. That code uses the state of all checkboxes in its algorithm.

However, I would like them to ALSO behave like radiobuttons upon doubleclick. That is, if you doubleclick one, it should become checked (regardless of its previous state) and all others will become un-checked.

Unfortunately there’s no doubleclick event for a checkbox. So clearly, I need to simulate a doubleclick by using mousedown (or mouse up) and a combination of timers, a stopwatch, etc.

Ultimately I know I’ll find a solution through experimentation, so if I come up with a good solution I’ll post it here. But I have a feeling others have “simulated doubleclicks” before and if someone can post a good snippet for creating such an event from the mousedown event, that would be great.

P.S. The snippet should somehow involve SystmInformation.DoubleClickTime. (This is the number of milliseconds that distinguishes a doubleclick from “two singleclicks”. It may be different from one machine to the next.) Code for a single click should NOT run until that much time has elapsed, to ensure that a doubleclick isn’t pending. (Because as I mentioned, the code uses the state of all checkboxes.)

P.P.S. I’m using VB.NET Express 2008 for a winforms app, but I can probably translate form C# if needed and I figure this probably applies all across .NET platforms.

  • 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-29T09:40:14+00:00Added an answer on May 29, 2026 at 9:40 am

    Surgery is required, the CheckBox class was written to assume that standard click and double-click behavior is turned off. This code worked, you’ll have to give up on the MouseUp event:

    Imports System.ComponentModel
    
    Public Class MyCheckBox
        Inherits CheckBox
    
        Public Sub New()
            Me.SetStyle(ControlStyles.StandardClick Or ControlStyles.StandardDoubleClick, True)
        End Sub
    
        Protected Overrides Sub OnMouseUp(ByVal mevent As System.Windows.Forms.MouseEventArgs)
            '' NOTE: do *not* call the base method
            MyBase.ResetFlagsandPaint()
        End Sub
    
        <EditorBrowsable(EditorBrowsableState.Always), Browsable(True)> _
        Public Shadows Custom Event DoubleClick As EventHandler
            AddHandler(ByVal value As EventHandler)
                AddHandler MyBase.DoubleClick, value
            End AddHandler
            RemoveHandler(ByVal value As EventHandler)
                RemoveHandler MyBase.DoubleClick, value
            End RemoveHandler
            RaiseEvent(ByVal sender As Object, ByVal value As EventArgs)
                Throw New InvalidOperationException  '' should never be raised by user code
            End RaiseEvent
        End Event
    End Class
    

    An event handler could look like this:

    Private Sub MyCheckBox_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
        Handles MyCheckBox1.DoubleClick, MyCheckBox2.DoubleClick, MyCheckBox3.DoubleClick, MyCheckBox4.DoubleClick
    
        For Each box As CheckBox In GroupBox1.Controls
            box.Checked = box.Equals(sender)
        Next
    End Sub
    

    There might be some surgery side-effects, I didn’t see any but didn’t test it thoroughly. I recommend you do not actually do this, the feature is massively undiscoverable. No user will ever realize that a double-click now does something special.

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

Sidebar

Related Questions

If I have a few checkboxes like the following: <input type=checkbox onchange=foo(bar); /> Bar
I have made a Win Form and have a few controls like checkboxes, radio
i have an app that has a few checkboxes in the settings and then
I have few different applications among which I'd like to share a C# enum.
I have few question in this regard When you create an internet page, does
We have few components like libraries dlls When initially created I ran the following
I have a few checkboxes that submit and change an attribute's value on my
I have a few checkboxes values of which are posted to action, and when
I tried a few things but this week i feel like my brain's having
I have an UpdatePanel in a Repeater. There are a few CheckBoxes in 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.