2020年5月18日 星期一

vb.net listview顯示右鍵選項 [Listview show click menu]


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
    Private Sub ListView1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseUp

        If e.Button = Windows.Forms.MouseButtons.Right Then

            If ListView1.HitTest(e.Location).Item Is Nothing Then

            ContextMenuStrip1.Show(ListView1, e.Location)

            End If

        End If

    End Sub

沒有留言:

張貼留言