Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, Guys, I am facing an issue and issue is I have 9 checkboxes and 9 combo box item in combo box I want if I checked checkbox1 so combo box item 1 text = checkbox1 text
please see the screenshot
screenshot1 — imgbb.com[^]
thanks in advance

What I have tried:

if(checkBox1.Checked == true)
{
comboBox2.SelectedIndex = 0;
comboBox1.SelectedItem.Text = "saturday";
}
Posted
Updated 26-Oct-17 20:42pm
Comments
Karthik_Mahalingam 27-Oct-17 5:47am    
1 combobox or multiple ?

1 solution

If I understood it right you should change your code like this :
C#
if(checkBox1.Checked == true)
 {
 comboBox1.Items(0) = "saturday";
 } 

'SelectedItem' will work too - but only if you have allready select an Item.
Also you should make sure that each Item you want to use is existing ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900