Click here to Skip to main content
15,906,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a combobox with 6 items.
By selecting each of them 2 groupboxes with 5 controls each are activated.
My code is smth like
C#
private void combo1_SelectedIndexChanged(object sender, EventArgs e)
      {
          switch (combo1.SelectedIndex)
          {
              case 1:
                  groupBox1.Visible = true;
                  groupBox2.Visible = true;
                  break;

              case 2:
                  groupBox1.Visible = false;
                  groupBox2.Visible = true;
                  break;


How to separate code for each of comboxbox items because controls in groupboxes have different values and calculated fields?

Regards
Posted
Comments
Michael Waguih 21-May-11 5:30am    
Please try to explain more your problem.
It is not clear enough.

1 solution

As far as I can tell, you've already done that with the switch statement.
 
Share this answer
 
Comments
KORCARI 21-May-11 5:35am    
I thought of creating separate classes for each item in a form of class libraries but not quite sure how to do it and if it is worthy of

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