VIS_E-EYES: 2010

Minggu, 21 November 2010

Hallo

Hallo, aku akan mengasih code vb untuk kalian
Code ini adalah code untuk membuat list view control:


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