Formumuza 2 listbox, 1 text kutusu, 1 check box, listemize 14 tane comman yerleştiriyoruz ve ileme başlayalım.
Dim A As Integer
Private Sub Command1_Click()
For I = 65 To 110
Me.List1.AddItem Chr(I)
Next
End Sub
Private Sub Command10_Click()
x = Me.List2.ListIndex
MsgBox Me.List2.List(x)
End Sub
Private Sub Command11_Click()
Me.List1.Clear
End Sub
Private Sub Command12_Click()
x = Me.List1.ListCount
MsgBox x
End Sub
Private Sub Command13_Click()
x = Me.List2.ListCount
MsgBox x
End Sub
Private Sub Command14_Click()
Me.List2.Clear
End Sub
Private Sub Command2_Click()
For I = 0 To Me.List1.ListCount - 1
Me.List2.AddItem Me.List1.List(I)
Next
List1.Clear
End Sub
Private Sub Command3_Click()
On Error Resume Next
For I = 0 To Me.List1.ListCount - 1
If Me.List1.Selected(I) = True Then
If I = Me.List1.ListCount Then Exit Sub
List2.AddItem List1.List(I)
List1.RemoveItem I
I = I - 1
End If
Next
End Sub
Private Sub Command4_Click()
On Error Resume Next
For I = 0 To Me.List2.ListCount - 1
If Me.List2.Selected(I) = True Then
If I = Me.List2.ListCount Then Exit Sub
List1.AddItem List2.List(I)
List2.RemoveItem I
I = I - 1
End If
Next
End Sub
Private Sub Command5_Click()
For I = 0 To Me.List2.ListCount - 1
Me.List1.AddItem Me.List2.List(I)
Next
List2.Clear
End Sub
Private Sub Command6_Click()
On Error Resume Next
For I = O To Me.List1.ListCount - 1
If Me.List1.Selected(I) = True Then
If I = Me.List1.ListCount Then Exit Sub
Me.List1.RemoveItem I
I = I - 1
End If
Next
End Sub
Private Sub Command7_Click()
x = Me.List1.ListIndex
MsgBox Me.List1.List(x)
End Sub
Private Sub Command8_Click()
If Me.Text1.Text = "" Then Exit " boşluk kaydedilmemesi için
If Check1.Value = 1 Then Me.List1.AddItem Me.Text1.Text
If Check1.Value = 0 Then Me.List2.AddItem Me.Text1.Text
End Sub
Private Sub Command9_Click()
On Error Resume Next
For I = O To Me.List2.ListCount - 1
If Me.List2.Selected(I) = True Then
If I = Me.List2.ListCount Then Exit Sub
Me.List2.RemoveItem I
I = I - 1
End If
Next
End Sub
Alıntıdır.