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. Check one item in CheckedListbox

Check one item in CheckedListbox

Scheduled Pinned Locked Moved C#
jsonhelp
3 Posts 2 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.
  • P Offline
    P Offline
    psamy
    wrote on last edited by
    #1

    Hi, please help me out to check the CheckedListbox only one item at click, rest of the items should be unchecked.

    L 1 Reply Last reply
    0
    • P psamy

      Hi, please help me out to check the CheckedListbox only one item at click, rest of the items should be unchecked.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      It's easy : Use the event CheckedChanged then write this kind of code : Go to each item, checked whether the item is the item you just selected. If yes, then set the property "Checked" to true, otherwise false;

      P 1 Reply Last reply
      0
      • L Lost User

        It's easy : Use the event CheckedChanged then write this kind of code : Go to each item, checked whether the item is the item you just selected. If yes, then set the property "Checked" to true, otherwise false;

        P Offline
        P Offline
        psamy
        wrote on last edited by
        #3

        i found the solution , CheckedIndex is previously selected item index. private void chkProperties_ItemCheck(object sender, ItemCheckEventArgs e) { chkProperties.ItemCheck-=new ItemCheckEventHandler(chkProperties_ItemCheck); chkProperties.SetItemChecked(CheckedIndex,false); chkProperties.ItemCheck+=new ItemCheckEventHandler(chkProperties_ItemCheck); CheckedIndex=e.Index; }

        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