I had the need for a dropdown in my listview... did a bit of research, I did find some references, but all of it was pages of code with really complicated methods. I played around a bit, and found that the listview
(at least on .NET 4), gives us more than enough to work with to easily achieve this.
Here ya go...
Private Sub ListView1_DoubleClick(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ListView1.DoubleClick
ListView1.SelectedItems(0).BeginEdit()
drop_combo()
End Sub
Private Sub drop_combo()
Dim rect As New Rectangle
rect = ListView1.SelectedItems(0).GetBounds(ItemBoundsPortion.Label)
cbo_test.Visible = True
cbo_test.Parent = ListView1
cbo_test.Left = rect.Left - 2
cbo_test.Top = rect.Top
cbo_test.Width = rect.Width
End Sub
Private Sub hide_combo()
cbo_test.Visible = False
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
hide_combo()
End Sub