Listbox swap
-
Ok easy one for y'all, but Im stumped. I have 2 listboxes. First listbox is populated with the 12 months and when double clicked on a month, it needs to move to the other listbox. The second listbox is initially blank. Any ideas?? Thanks in advance Jason
-
Ok easy one for y'all, but Im stumped. I have 2 listboxes. First listbox is populated with the 12 months and when double clicked on a month, it needs to move to the other listbox. The second listbox is initially blank. Any ideas?? Thanks in advance Jason
Remove it from the items collection on one, and add it to the other. VB6 or VB.NET ? Christian Graus - Microsoft MVP - C++
-
Remove it from the items collection on one, and add it to the other. VB6 or VB.NET ? Christian Graus - Microsoft MVP - C++
1st Listbox has a collection of months. When double clicked on a month it moves to the 2nd Listbox. I would assume that I need to have it move back to the 1st listbox when double clicked as well. VB.Net Thanks Christian
-
1st Listbox has a collection of months. When double clicked on a month it moves to the 2nd Listbox. I would assume that I need to have it move back to the 1st listbox when double clicked as well. VB.Net Thanks Christian
Private Sub ListBox1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick Dim S As String = ListBox1.SelectedItem ListBox2.Items.Add(S) ListBox1.Items.Remove(S) End Sub Private Sub ListBox2_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.DoubleClick Dim S As String = ListBox2.SelectedItem ListBox1.Items.Add(S) ListBox2.Items.Remove(S) End Sub You'd need to add something to rearrange them in the right order, if you want that. Christian Graus - Microsoft MVP - C++
-
Private Sub ListBox1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick Dim S As String = ListBox1.SelectedItem ListBox2.Items.Add(S) ListBox1.Items.Remove(S) End Sub Private Sub ListBox2_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.DoubleClick Dim S As String = ListBox2.SelectedItem ListBox1.Items.Add(S) ListBox2.Items.Remove(S) End Sub You'd need to add something to rearrange them in the right order, if you want that. Christian Graus - Microsoft MVP - C++
CG, you da man as always. I knew it was something very simple. I couldn't see the forest because of the trees. Thanks again. I'll work on customizing it from here. THANKS AGAIN CHRISTIAN!!!! JB
-
CG, you da man as always. I knew it was something very simple. I couldn't see the forest because of the trees. Thanks again. I'll work on customizing it from here. THANKS AGAIN CHRISTIAN!!!! JB
*blush* you're welcome. Christian Graus - Microsoft MVP - C++