タイトル : Re: ListBoxの高度な使い方 投稿日 : 2006/05/15(Mon) 15:53 投稿者 : ハイタワー
[OSのVer]:Windows [VBのVer]:VB.NET とりあえず、私のコード途中なんですが 下記のような感じで作成しています。*印は不明確な部分で、わかりません。 流れは下記の感じなんですが。コードを記載しても動作できないのでどうんあn 感じになるかわかりません。SelectedIndexChangedでいいのかどうかも Private Sub ListBox1_SelectedIndexChanged(***************** Dim o,o2,i As Integer For o=0 To ListBox1.Items.Count -1 Select Case ListBox1.SelectItems(i) Case Is = ListBox1.Items(o) If ListBox2.Items.Count > 0 Then For o2 = 0 To ListBox2.Items.Count -1 If ListBox1.Items(o) = ListBox2.Items(o2) Then '同じ Exit For End If Next o2 If o2 < 0 Or ListBox2.Items.Count -1 < o2 Then ListBox2.Items.Add(ListBox1.Items(o)) Else End If Else ListBox2.Items.Add(ListBox1.Items(o)) End If Case ********* 'このあたりがわからない If ListBox2.Items.Count > 0 Then For o2 = 0 To ListBox2.Items.Count -1 If ListBox1.Items(o) = ListBox2.Items(o2) Then '同じ Exit For End If Next o2 If o2 >= 0 And o2 <= ListBox2.Items.Count -1 Then ListBox2.Items.Remove(o2) End If Else End If Case Else End Select Next o End Sub |