How to run same code in click event as the double click event?

后端 未结 3 499
小蘑菇
小蘑菇 2021-01-25 08:11

I have 4 items in a ListBox and each item does a specific thing when it gets clicked on.

But I also want the double click event to do the same thing as the click event.<

3条回答
  •  时光说笑
    2021-01-25 08:36

    Try Following Code!

    Private Sub ListBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.Click
    
        ListBox1_DoubleClick(sender, e)
    
    End Sub
    
    Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
        MsgBox(ListBox1.Items.Count)
    End Sub
    

提交回复
热议问题