0

I want to edit the data into the ListView of the first item. when i right click on item..But when i right click selected item not come in edit mode....Plz check it out..

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For lcount As Integer = 1 To 3
            ListView1.Items.Add(lcount.ToString, lcount - 1)
        Next
    End Sub

 Private Sub ListView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseClick
        If e.Button = Windows.Forms.MouseButtons.Right Then
            Dim ht As ListViewHitTestInfo = ListView1.HitTest(location)
            If ht.Location = ListViewHitTestLocations.Label Then
                ListView1.LabelEdit = True
                ht.Item.BeginEdit()
            End If
        End If
    End Sub
2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by GeekByChoiCe
0

where comes "location" from? did you set it as global variable? if not then this is might be the problem. else check if the location got the correct value.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.