One thing is that if you have code that should remove the text box, you didn't show it. Have a try with something like
- When a listview row is clicked (not double clicked), first check if there is a text box in the window level variable
- If there is, hide it and get rid of the instance
- After that create a new text box and store it into a window level variable
If not really needed, I wouldn't try to reuse the objects since it just introduces unnecessary complexity into the logic.
ADDITION
Consider the following example. It contains a lot of assumptions so modify it based on your requirements
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim a As ListViewItem
a = Me.ListView1.Items.Add("One")
a.SubItems.Add("1")
a = Me.ListView1.Items.Add("Two")
a.SubItems.Add("2")
a = Me.ListView1.Items.Add("Three")
a.SubItems.Add("3")
End Sub
Private Sub ListView1_Click(sender As Object, e As EventArgs) Handles ListView1.Click
If Not txb Is Nothing Then
RemoveHandler txb.Leave, AddressOf txb_Leave
ListView1.Controls.Remove(txb)
txb.Hide()
txb = Nothing
End If
txb = New TextBox()
txb.Text = Me.ListView1.SelectedItems(0).SubItems(1).Text
txb.Location = New Point(ListView1.SelectedItems.Item(0).SubItems.Item(1).Bounds.X, ListView1.SelectedItems.Item(0).SubItems.Item(1).Bounds.Y)
txb.Tag = Me.ListView1.SelectedItems(0)
AddHandler txb.Leave, AddressOf txb_Leave
ListView1.Controls.Add(txb)
End Sub
Private Sub txb_Leave(sender As Object, e As EventArgs) Handles TextBox1.Leave
Dim item As ListViewItem
item = CType(txb.Tag, ListViewItem)
item.SubItems(1).Text = txb.Text
End Sub