Illusionistx
Newcomer
- Joined
- Aug 31, 2009
- Messages
- 2
I'm using the following code to position a textbox over the selected listview subitem
But this only works correctly when clicking on an actual subitem
When used on the first column in the listview it makes txtEdit.width = listview.width and not just that column
any ideas on how to fix this or determine whether i clicked the first column or not?
Code:
dim selSubitem as ListViewItem.ListViewSumItem
Private Sub ListView1_MouseDoubleClick(......).....
Dim info As ListViewHitTestInfo = ListView1.HitTest(e.X, e.Y)
'MessageBox.Show(info.Location.ToString)
selSubItem = info.SubItem
txtEdit.Width = info.SubItem.Bounds.Width + 2
txtEdit.Height = info.SubItem.Bounds.Height
txtEdit.Location = info.SubItem.Bounds.Location + ListView1.Location
txtEdit.Text = info.SubItem.Text
txtEdit.Visible = True
txtEdit.Focus()
txtEdit.SelectAll()
End Sub
But this only works correctly when clicking on an actual subitem
When used on the first column in the listview it makes txtEdit.width = listview.width and not just that column
any ideas on how to fix this or determine whether i clicked the first column or not?