Question ListView + Edit Item

sonia.sardana

Active member
Joined
Jan 25, 2009
Messages
35
Programming Experience
Beginner
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..

VB.NET:
 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
 
Back
Top