Aşağıdaki kod bir class module uygulaması. Yapmak istediğim ise, aktif listbox içinde bir satır seçili iken diğer listbox nesnelerindeki seçimler iptal olsun. Aşağıdaki kod bazen bu şekilde çalışıyor, bazen çalışmıyor. Nerede hata yaptığımı bulamadım.
Şimdiden teşekkürler.
Şimdiden teşekkürler.
Kod:
Public WithEvents Lbox As MSForms.ListBox
Private Sub Lbox_Click()
With UserForm1
Select Case .ActiveControl.Name
Case "ListBox1": .ListBox2.ListIndex = -1: .ListBox3.ListIndex = -1: .ListBox4.ListIndex = -1
Case "ListBox2": .ListBox3.ListIndex = -1: .ListBox4.ListIndex = -1: .ListBox1.ListIndex = -1
Case "ListBox3": .ListBox4.ListIndex = -1: .ListBox2.ListIndex = -1: .ListBox1.ListIndex = -1
Case "ListBox4": .ListBox1.ListIndex = -1: .ListBox2.ListIndex = -1: .ListBox3.ListIndex = -1
End Select
End With
End Sub