Posted By

sekihin on 08/31/11


Tagged

Winform ListBox c#


Versions (?)

detect an item double click in a winforms listbox control


 / Published in: C#
 

URL: http://stackoverflow.com/questions/3544133/i-want-to-detect-an-item-double-click-in-a-winforms-listbox-control-how-to-hand

  1. private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
  2. {
  3. if(listBox1.SelectedIndex != -1)
  4. {
  5. var rect = listBox1.GetItemRectangle(listBox1.SelectedIndex);
  6. if(rect.Contains(e.Location))
  7. {
  8. // process item data here
  9. }
  10. }
  11. }

Report this snippet  

You need to login to post a comment.