Displaying forms 2&3 from a combo box on form 1
I understand that my problem is probably really basic but any help would be greatly appreciated. Anyway, I have form1, form2, and form3. On form1 there is a combo box with two selectable values: form2 and form3. How would I go about connecting the actual forms to the selectable values in the combo box, so that selecting a particular value will open the corresponding form?

Manikavelu VelayuthamRank #413 · 6K reputationPosted Sep 8, 2010, 11:43 PM EDT
Hope this code would help you a lot and dont forget to mark this answer.
if (comboBox1.SelectedItem.ToString().Equals("Form2"))
{
Form2 objForm = new Form2();
objForm.Show();
}
else if (comboBox1.SelectedItem.ToString().Equals("Form3"))
{
Form3 objForm = new Form3();
objForm.Show();
}
Manikavelu VelayuthamRank #413 · 6K reputationPosted Sep 8, 2010, 10:41 PM EDT
There you need to create an instance of the Form2 Or Form3 based on the selection of the combo box.
Finally you should show the form using Form2.Show or Form3.Show
Frank Mills6 reputationPosted Sep 8, 2010, 10:55 PM EDT
Manikavelu VelayuthamRank #413 · 6K reputationPosted Sep 8, 2010, 10:57 PM EDT
objForm2.Show();
Hope this code would help you.
Frank Mills6 reputationPosted Sep 8, 2010, 11:34 PM EDT
objForm2.Show();
This particular string of code does help me to access Form2 from Form1, however, my problem is that I have 3 forms and I need to be able to access Form 2 and 3 from a combo box on Form 1. Therefore, if I simply plug in the above string of code, any value that I choose within the combo box only takes me to form 2. How do I make it so that selecting "form 1" or "form 2" from within the combo box will open the corresponding form?
Manikavelu VelayuthamRank #413 · 6K reputationPosted Sep 8, 2010, 11:47 PM EDT