I tried, but I can't solve the problem.
Now I changed Spinbutton. It doesn't have Private Up or Down, but:
Private Sub SpinButton1_Change()
If SpinButton1.Value > ListBox1.ListCount Then
SpinButton1.Value = ListBox1.ListCount
End If
If ListBox1.ListCount > SpinButton1.Value And SpinButton1.Value >= 0 And SpinButton1.Value <= ListBox1.ListCount Then
ListBox1.ListIndex = SpinButton1.Value
Label1.Caption = SpinButton1.Value
End If
End Sub
and
Private Sub ListBox1_Change()
(...)
SpinButton1.Value = ListBox1.ListIndex
TextBox1.Text = MyArray(ListBox1.ListIndex, 2)
TextBox1.SetFocus 'I don't know why, but textbox1 just get the focus every two times that I click the spinbutton.
End Sub
Bookmarks