
Private Sub lstOperatori_DblClick(ByVal Cancel As MSForms.ReturnBoolean) r=lstOperatori.listindex end sub Private Sub lstOperatori_Click() r=lstOperatori.listindex end sub |
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = xlPrimaryButton Then
MsgBox "Left click on " & ListBox1.ListIndex
ElseIf Button = xlSecondaryButton Then
MsgBox "Right click on " & ListBox1.ListIndex
End If
End Sub |
Option Explicit
Private Sub UserForm_Initialize()
With ListBox1
.AddItem "0"
.AddItem "1"
.AddItem "2"
End With
End Sub
Private Sub ListBox1_Click()
UserForm1.Caption = "Clicked " & ListBox1.ListIndex
End Sub
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
UserForm1.Caption = "Double clicked " & ListBox1.ListIndex
End Sub
|
