Combobox'a tekrarsız isim girmek
Combobox'a tekrarsız isim girmek
Private Sub Command1_Click()
Dim X As Integer
Dim Y As Integer
Dim var As Boolean
For X = 0 To List1.ListCount - 1
List1.Selected(X) = True
var = False
For Y = 1 To Combo1.ListCount + 1
If List1.Text = Combo1.List(Y - 1) Then var = True: Exit For
Next Y
If var = False Then
Combo1.AddItem List1.Text
End If
Next X
End Sub
Private Sub Form_Load()
List1.AddItem "ahmet"
List1.AddItem "ahmet"
List1.AddItem "ahmet"
List1.AddItem "ali"
List1.AddItem "ali"
List1.AddItem "ali"
End Sub