24h購物| | PChome| 登入
2008-04-03 10:01:54| 人氣106| 回應1 | 上一篇 | 下一篇

新增項目練習

推薦 0 收藏 0 轉貼0 訂閱站台

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

台長: ,,飛ㄦ*
人氣(106) | 回應(1)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類 | 個人分類: 程式設計篇 |
此分類下一篇:datetimepicker 練習
此分類上一篇:計算成績

你最近走火入魔噢
2008-04-03 19:57:02
版主回應
這叫造福社會!!
2008-04-03 23:59:26
是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文