Avatar of PeterBaileyUk
PeterBaileyUk

asked on 

Which Listbox event in vb.net

I have a listbox which has multiple selection enabled, I have a combo box on the form and I would like that to be populated by those selected in the listbox.

so if I select the first item in the listbox the combo gets updated to include that item, when another item is selected then the combo gets that row added.

Not sure which event to use

I have this code:

 For Each Item In ListCW.SelectedItems
                    If Not String.IsNullOrWhiteSpace(Item) Then
CBCWSelectedItems.additem Item.ToString()
                    Else
                        'do nothing whitespace
                    End If
                Next

Open in new window

Visual Basic.NET

Avatar of undefined
Last Comment
Fernando Soto

8/22/2022 - Mon