locked
multi select combo box in vb .net RRS feed

  • Question

  • Hi

    i have checked various source codes on the interenet but i really have difficulty in converting the  c# samples to vb.net or understanding the samples.

    Can some one please help me with vb.net code to acheive multiselect in combobox Win forms.


    lucky


    • Edited by LuckyDba Monday, September 9, 2013 7:22 PM
    Monday, September 9, 2013 7:21 PM

Answers

  • Hello Lucky,

    Although I do not see this working well for users in regards to having a ComboBox allow multiple items selected you might consider a custom control by .paul., one of the contruibutors here

    http://code.msdn.microsoft.com/windowsdesktop/CheckedCombobox-Control-52dbdb37

    Custom control left, listbox controls to show what is selected and what is not selected.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.


    • Edited by KareninstructorMVP Monday, September 9, 2013 7:32 PM ...............
    • Marked as answer by LuckyDba Monday, September 9, 2013 10:16 PM
    Monday, September 9, 2013 7:32 PM
  • A multi select combobox is a strange thing. 

    A combobox shows always the selected item in the textbox part. 

    How can that be done with more than one.

    Try instead of that the Checked Listbox

    http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.aspx

    Be aware this is for windows forms, if you are using another presentation (for instance XAML or Modern) then tell which that is.


    Success
    Cor


    • Edited by Cor Ligthert Monday, September 9, 2013 8:48 PM
    • Marked as answer by LuckyDba Monday, September 9, 2013 10:18 PM
    Monday, September 9, 2013 8:48 PM

All replies

  • Hello Lucky,

    Although I do not see this working well for users in regards to having a ComboBox allow multiple items selected you might consider a custom control by .paul., one of the contruibutors here

    http://code.msdn.microsoft.com/windowsdesktop/CheckedCombobox-Control-52dbdb37

    Custom control left, listbox controls to show what is selected and what is not selected.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.


    • Edited by KareninstructorMVP Monday, September 9, 2013 7:32 PM ...............
    • Marked as answer by LuckyDba Monday, September 9, 2013 10:16 PM
    Monday, September 9, 2013 7:32 PM
  • A multi select combobox is a strange thing. 

    A combobox shows always the selected item in the textbox part. 

    How can that be done with more than one.

    Try instead of that the Checked Listbox

    http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.aspx

    Be aware this is for windows forms, if you are using another presentation (for instance XAML or Modern) then tell which that is.


    Success
    Cor


    • Edited by Cor Ligthert Monday, September 9, 2013 8:48 PM
    • Marked as answer by LuckyDba Monday, September 9, 2013 10:18 PM
    Monday, September 9, 2013 8:48 PM
  • thank you thank you soo much..i have been trying to do this the whole day.

    Have a good day :)



    lucky

    Monday, September 9, 2013 10:16 PM
  • Thank you so much Cor.I used checklist box but i was told by my senior to use multicheck combo box since listbox was taking more space on the form.


    lucky

    Monday, September 9, 2013 10:18 PM
  • how  to insert in my project
    Sunday, November 29, 2015 12:10 PM
  • how  to insert in my project
    Add CheckedComboBox.vb to your project, compile then the control will appear at the top of the toolbox which you can then place on a form.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.
    Microsoft Developer tools
    Developer’s Guide to Windows 10 video series

    Sunday, November 29, 2015 12:52 PM
  • THANKS YOU
    Sunday, November 29, 2015 8:34 PM
  • I have data Source to ComboBox as Following

    cbAffairStatusID.DataSource = UsersDataAccess.GetForSearch(AffairDataAccess.GetAllAffairStatus)

    if I load the Data In ComboBox  Choice is Not Visible

    Monday, November 30, 2015 9:19 AM
  • I have data Source to ComboBox as Following

    cbAffairStatusID.DataSource = UsersDataAccess.GetForSearch(AffairDataAccess.GetAllAffairStatus)

    if I load the Data In ComboBox  Choice is Not Visible

    Looks to me like an issue with your logic as the exception thrown indicates the integer is out of range. Best to step thru the code with the debugger for this and it's not from what I see an issue with the control. If you feel it's an issue with the control best to contact the original author and ask them.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.
    Microsoft Developer tools
    Developer’s Guide to Windows 10 video series

    Monday, November 30, 2015 10:47 AM