Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ChekedListBox check only if mouse is over checkbox

ChekedListBox check only if mouse is over checkbox

Scheduled Pinned Locked Moved C#
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    f istvan
    wrote on last edited by
    #1

    Hi everyone! I would like the checkedlistbox control to change the checked state of an item only if I click on the checkbox. Is there a (not too difficult) way to do that? Thanks in advance! Istvan

    D 1 Reply Last reply
    0
    • F f istvan

      Hi everyone! I would like the checkedlistbox control to change the checked state of an item only if I click on the checkbox. Is there a (not too difficult) way to do that? Thanks in advance! Istvan

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      The only thing I can think of is to set the SelectionMode to None. Now, in the mouse click event, get the location of click. If it is on the checkbox, programmatically check the item.

      The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures." जय हिंद

      M 1 Reply Last reply
      0
      • D dan sh

        The only thing I can think of is to set the SelectionMode to None. Now, in the mouse click event, get the location of click. If it is on the checkbox, programmatically check the item.

        The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures." जय हिंद

        M Offline
        M Offline
        MadArtSoft
        wrote on last edited by
        #3

        You have to use HitTestInfo function to check current mouse position and then automatically check or uncheck the box. Sorry, this method doesn't works with CheckedListBox control.

        C# controls, .Net components. Help Desk Software

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups