Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load CheckedListBox1.Items.Add("氏名") CheckedListBox1.Items.Add("氏名カナ") CheckedListBox1.Items.Add("郵便番号") CheckedListBox1.Items.Add("住所") CheckedListBox1.Items.Add("電話番号") CheckedListBox1.Items.Add("FAX番号")
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim intCount As Integer Dim intCLICount As Integer intCLICount = CheckedListBox1.CheckedItems.Count - 1 For intCount = 0 To intCLICount '右→が押されたとき CheckedListBox2.Items.Add(CheckedListBox1.CheckedItems(0)) CheckedListBox1.Items.Remove(CheckedListBox1.CheckedItems(0)) Next End Sub
Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click Dim intCount As Integer Dim intCLICount As Integer intCLICount = CheckedListBox2.CheckedItems.Count - 1 For intCount = 0 To intCLICount '左←が押されたとき CheckedListBox1.Items.Add(CheckedListBox2.CheckedItems(0)) CheckedListBox2.Items.Remove(CheckedListBox2.CheckedItems(0)) Next