Soru Buton ile Listbox'da Seçim Yapma ve Seçimi Kaldırma

likaba

Altın Üye
Katılım
3 Mayıs 2016
Mesajlar
158
Excel Vers. ve Dili
2016 Türkçe
Altın Üyelik Bitiş Tarihi
21-12-2027
Merhabalar,

"Tümünü Seç" ve "Tümünü Kaldır" düğmelerini kullanarak Listbox2'de işlem yapmak istiyorum. Bunu nasıl gerçekleştirebilirim?212337
 

Ziynettin

Destek Ekibi
Destek Ekibi
Katılım
18 Nisan 2008
Mesajlar
1,125
Excel Vers. ve Dili
office2010
Seçili yapar.

Kod:
Private Sub OptionButton1_Click()
    If OptionButton1 = True Then
        For i = 0 To ListBox2.ListCount - 1
            ListBox2.Selected(i) = True
        Next i
    End If
End Sub

Seçimi Kaldırır.

Kod:
Private Sub OptionButton2_Click()
    If OptionButton2 = True Then
        For i = 0 To ListBox2.ListCount - 1
            ListBox2.Selected(i) = False
        Next i
    End If
End Sub
 

likaba

Altın Üye
Katılım
3 Mayıs 2016
Mesajlar
158
Excel Vers. ve Dili
2016 Türkçe
Altın Üyelik Bitiş Tarihi
21-12-2027
Seçili yapar.

Kod:
Private Sub OptionButton1_Click()
    If OptionButton1 = True Then
        For i = 0 To ListBox2.ListCount - 1
            ListBox2.Selected(i) = True
        Next i
    End If
End Sub

Seçimi Kaldırır.

Kod:
Private Sub OptionButton2_Click()
    If OptionButton2 = True Then
        For i = 0 To ListBox2.ListCount - 1
            ListBox2.Selected(i) = False
        Next i
    End If
End Sub
Çok teşekkür ederim Ziynettin Bey
 
Üst