❔ ComboBox | When in ComboBox1 "A" selected then show in combobox2 "B"
Hello everyone,
im from Germany so sorry for my bad english. I need "Short"-Help,
I´ve got 4 comboBoxes as ja simple Dropdown. Now I want that if i select in comboBox1 "one" thats comboBox2 shows me "Text A, Text B" but if i select "two" in comboBox1 thats comboBox2 shows me "Text C, Text D".
Can you help me? Im a bit of tired xd
8 Replies
You need to add a SelectedIndexChanged event to your first combo box.
and which code i tipe in?
code that changes the text of the entries in comboBox2
okay mate thanks, very helpful 😅
- subscribe to the SelectedIndexChanged event of comboBox1
- in the event handler method for SelectedIndexChanged
* Get the
conboBox1.SelectedItem
* Based on the value of the selected item add the choices to comboBox2 using comboBox2.Items.AddRange
string curItem = comboBox4.SelectedItem.ToString();
int index = comboBox4.FindString("Hamburg");
if (index == -1)
comboBox1.Text = "Derzeit keine Einträge vorhanden";
else
comboBox1.Text = "Hamburg-Lübeck";
i have that now but it didnt work
only the first line of that code matches part of my suggestion 🤔
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.