How to add Double Click mouse event to listbox?

前端 未结 3 811
清酒与你
清酒与你 2020-12-21 20:41

I would like to add a double click mouse event to a listbox. When I double click an item I\'d like to get the specific item and assign a method. I have been searching for t

3条回答
  •  孤城傲影
    2020-12-21 21:41

    Simple sample to send selected item on a listbox:

    private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        string test = listBox1.SelectedItem.ToString();
    }
    

提交回复
热议问题