Dim intItemExists As Integer = -1 Dim strTransferItem As String = "" strTransferItem = ListBox1.Items(ListBox1.SelectedIndex).ToString If ListBox2.FindStringExact(strTransferItem) = -1 Then ListBox2.Items.Add(strTransferItem) Else 'Item found and already exists in the target listbox MessageBox.Show(String.Format("Item ""{0}"" is already in the target list box", strTransferItem)) LCOUNT2.Text = ListBox1.Items.Count
If ListBox1.SelectedItems.Count > 0 Then 'Your Code goes here End If
If ListBox1.SelectedItems.Count < 1 Then Exit Sub
If ListBox2.FindStringExact(strTransferItem) = -1 Then ListBox2.Items.Add(strTransferItem) Else
ListBox1.Items(ListBox1.SelectedIndex)
Items
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)