Listbox yerine Listview kullanımı.

Katılım
14 Ağustos 2009
Mesajlar
51
Excel Vers. ve Dili
2007 TR
Merhabalar arkadaşlar.
Üzerinde çalıştığım bir programda, textbox üzerinden sorgu yaparak sonuçlarını listbox'ta listeliyorum, ancak listbox'un kolon sayısı yetersiz olduğundan bu listelemeyi listview ile yapmak istiyorum.
aşağıda verdiğim kodları listview'e çeviremedim, yardımcı olursanız çok memnun olurum, Saygılarımla...

Private Sub Label1_Click()
If TextBox1.Text = "" Then
MsgBox "sorgulanacak okul adı girin."
Exit Sub
End If
A = UCase(Replace(Replace(TextBox1.Text, "ı", "I"), "i", "İ"))
ListBox1.Clear
Set sf1 = Sheets("veri")
ListBox1.ColumnCount = 12
ListBox1.IntegralHeight = 17
ListBox1.ColumnWidths = "75;75;55;55;65;80;60;60;60;90;90"
ListBox1.AddItem
For FD = 1 To 10
ListBox1.List(s, FD - 1) = sf1.Cells(1, FD)
Next
s = s + 1
ListBox1.AddItem
For FD = 1 To 10
ListBox1.List(s, FD - 1) = ""
Next
s = s + 1
For sat = 1 To sf1.Cells(65536, "J").End(xlUp).Row
If A = sf1.Cells(sat, 10).Value Then
ListBox1.AddItem
ListBox1.List(s, 0) = sf1.Cells(sat, 1)
ListBox1.List(s, 1) = sf1.Cells(sat, 2)
ListBox1.List(s, 2) = sf1.Cells(sat, 3)
ListBox1.List(s, 3) = sf1.Cells(sat, 4)
ListBox1.List(s, 4) = sf1.Cells(sat, 5)
ListBox1.List(s, 5) = sf1.Cells(sat, 6)
ListBox1.List(s, 6) = sf1.Cells(sat, 7)
ListBox1.List(s, 7) = sf1.Cells(sat, 8)
ListBox1.List(s, 8) = sf1.Cells(sat, 9)
ListBox1.List(s, 9) = sf1.Cells(sat, 10)
s = s + 1
End If
Next
If s = 2 Then
MsgBox "bu isimde okul bulunamadı."
End If
End Sub
 
Üst