06/11/15 12:21:30
>>269
そういう時は先生にエロ画像でも提供汁。気がきかねぇ。
Dim x As Integer
Dim y As System.Windows.Forms.SelectionMode = ListBox1.SelectionMode
'描画停止
ListBox1.BeginUpdate()
'選択解除
ListBox1.ClearSelected()
'複数選択可に変更
ListBox1.SelectionMode = SelectionMode.MultiExtended
For x = 0 To ListBox1.Items.Count - 1
If TextBox1.Text.Equals(ListBox1.Items.Item(x).ToString()) Then
ListBox1.SetSelected(x, True)
End If
Next x
'選択されている項目を削除
For x = ListBox1.SelectedIndices.Count - 1 To 0 Step -1
ListBox1.Items.RemoveAt(ListBox1.SelectedIndices(x))
Next x
'選択モードを退避前に戻す。
ListBox1.SelectionMode = y
'描画再開
ListBox1.EndUpdate()