PDA

View Full Version : جستجو در کنترل ListView :D



armin_izer
چهارشنبه 05 اسفند 1383, 02:02 صبح
Private Sub Form_Load()
With ListView1
.ListItems.Add Key:="k1", Text:="Fred"
.ListItems.Add Key:="k2", Text:="Barney"
.ListItems.Add Key:="k3", Text:="Wilma"
.ListItems.Add Key:="k4", Text:="Betty"
.ListItems.Add Key:="k5", Text:="Pebbles"
.ListItems.Add Key:="k6", Text:="Bam Bam"
End With
End Sub

Private Sub Command1_Click()
Dim itm As ListItem
With ListView1
Set itm = .FindItem(Text1.Text, lvwText, , lvwPartial)
If Not itm Is Nothing Then
.ListItems(itm.Index).Selected = True
.SetFocus
End If
End With
Set itm = Nothing
End Sub



omidvaram behetoon komak karde bashe in code :D