2008-04-03 10:01:54,,飛ㄦ*

新增項目練習

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim I As Integer
For I = 0 To ListBox1.Items.Count - 1
If ListBox1.Items(I).ToString = TextBox1.Text Then
Exit Sub
End If
Next
ListBox1.Items.Add(TextBox1.Text)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.Clear()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
ListBox1.Items.Remove(ListBox1.SelectedItem)
ListBox2.Items.Remove(ListBox2.SelectedItem)
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If ListBox1.SelectedItems.Count = 0 Then Exit Sub
Do
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.Remove(ListBox1.SelectedItem)
Loop Until ListBox1.SelectedItems.Count = 0
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
If ListBox2.SelectedItems.Count = 0 Then Exit Sub
Do
ListBox1.Items.Add(ListBox2.SelectedItem)
ListBox2.Items.Remove(ListBox2.SelectedItem)
Loop Until ListBox2.SelectedItems.Count = 0
End Sub

上一篇:計算成績

下一篇:datetimepicker 練習

2008-04-03 19:57:02

你最近走火入魔噢

版主回應
這叫造福社會!! 2008-04-03 23:59:26