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. How can I prevent listview item checked from double-click?

How can I prevent listview item checked from double-click?

Scheduled Pinned Locked Moved C#
helpquestion
2 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.
  • V Offline
    V Offline
    Vu Truong
    wrote on last edited by
    #1

    Hello all, I don't want my listview item to be checked when I double-click on it. I tried to catch double-click event, but it does not help me at all. The double-click event always occurs after the item checked event does. I met another problem with listview. I used e.NewValue=e.CurrentValue in my function OnItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e) that handles the item checked event. But e.NewValue=e.CurrentValue code does not work. Please someone talks to me what wrong with my listview? How can I do in this issue? Thanks for your help.

    D 1 Reply Last reply
    0
    • V Vu Truong

      Hello all, I don't want my listview item to be checked when I double-click on it. I tried to catch double-click event, but it does not help me at all. The double-click event always occurs after the item checked event does. I met another problem with listview. I used e.NewValue=e.CurrentValue in my function OnItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e) that handles the item checked event. But e.NewValue=e.CurrentValue code does not work. Please someone talks to me what wrong with my listview? How can I do in this issue? Thanks for your help.

      D Offline
      D Offline
      dynamic
      wrote on last edited by
      #2

      the item click event does occur before the double click ( because you've already clicked it the first time ,before releasing the mouse for the second click ), i think that you would have to determine if the user was clicking on the checkedbox area or over the actual label , then handle it that way. you can obviously do this :listView1.SelectedItems[0].Checked=false; but the user will see the checkbox flicker to checked then back to unchecked.


      Private void ExpectingTwins(string twins)
      {
      switch(twins)
      {
      Case ("twins on the way"):
      MessageBox.Show("for mr and mrs dynamic","twins on the way");
      break;
      }
      }


      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