J
Josef Brunner
Hi,
I have a problem using two ListView controls on one and the same form:
Problem: The second ListView is never focused. No matter where I "click" non
of the items within the ListView is focused.
This is only the matter for the secondly added ListView!!! The first one
works perfectly!!
Example:
' Works perfectly -- Displays a message box with the text of the item where
I clicked
Private Sub ListView1_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown
MsgBox("focussed item :" + ListView1.FocusedItem.Text.ToString)
End Sub
' Crashes saying that ListView2 has no FocusedItem! But I'm sure I
definitely clicked on the item like I do on the first ListView
Private Sub ListView2_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ListView2.MouseDown
MsgBox("focussed item :" + ListView2.FocusedItem.Text.ToString)
End Sub
Any ideas would be very appreciated,
Joe
I have a problem using two ListView controls on one and the same form:
Problem: The second ListView is never focused. No matter where I "click" non
of the items within the ListView is focused.
This is only the matter for the secondly added ListView!!! The first one
works perfectly!!
Example:
' Works perfectly -- Displays a message box with the text of the item where
I clicked
Private Sub ListView1_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown
MsgBox("focussed item :" + ListView1.FocusedItem.Text.ToString)
End Sub
' Crashes saying that ListView2 has no FocusedItem! But I'm sure I
definitely clicked on the item like I do on the first ListView
Private Sub ListView2_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ListView2.MouseDown
MsgBox("focussed item :" + ListView2.FocusedItem.Text.ToString)
End Sub
Any ideas would be very appreciated,
Joe