J
Jack
Guest
Hello,
When the item is selected I need to enable cmdDelete btn.
and if there is not item selected cmdDelete btn must be disabled.
The problem with the code I use (see below) is that when user change the
selected item (or when user select item for the first time) the code below
does not "see" selected item with the first mouse click.
Private Sub lvSelLines_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
For i = lvSelLines.ListItems.Count To 1 Step -1
If lvSelLines.ListItems(i).Selected = True Then
cmdDelete.Enabled = True
Exit Sub
End If
Next
cmdDelete.Enabled = False
End Sub
How to correct that?
Jack
When the item is selected I need to enable cmdDelete btn.
and if there is not item selected cmdDelete btn must be disabled.
The problem with the code I use (see below) is that when user change the
selected item (or when user select item for the first time) the code below
does not "see" selected item with the first mouse click.
Private Sub lvSelLines_MouseDown(Button As Integer, Shift As Integer, x As
Single, y As Single)
For i = lvSelLines.ListItems.Count To 1 Step -1
If lvSelLines.ListItems(i).Selected = True Then
cmdDelete.Enabled = True
Exit Sub
End If
Next
cmdDelete.Enabled = False
End Sub
How to correct that?
Jack