nolubabalo dywili
asked on
how do i code for one of the items in a combobox? i want to select that item then it takes me to a new form.
i have multiple options on my combobox and i want, if someone chooses one, then it takes the person on the for suitable for that option.
you may have an array with the persons:
one for each option in the combobox.
if the user selects an option just take the corresponding item from array.
Sara
string[] array = { "John", "Mary", "Bob", "Ann" };
one for each option in the combobox.
if the user selects an option just take the corresponding item from array.
int rowSelected = combobox.GetSelection();
string personSelected;
if (rowSelected >= 0)
{
personSelected = array[rowSelected];
}
Sara
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
it will be like this;
Sub combobox_Click ()
select case combobox.text
case "Food"
frameFood.open
case "drink"
frameDrink.open
End Case
End Sub