I have several windows/forms in my application. I would like to do simple thing. Make a button on one form that will load and display another form. Simple as that.
I have tried the following, but with no success:
The following code is located in the start window, the one that start first when the application is loaded
Code |
The problem is with the menu.show();
It is underlined in red with the following error.
SQL |
When I type menu and I hit period, I should get a Show method, but its not there.
I dont know, this might be totally wrong way to do this thing. What is the easiest way to accomplish it?

ajay rajuRank #4,639 · 333 reputationPosted Apr 26, 2010, 4:22 AM EDT
first create a object to the form (which form u want to show/display), this code write under button
Form2 f2 = new form2(); // write ur Form name in place of Form2
f2.Show();
(or)
and u set a property of Form : IsMdiContainer is true (which is parent) and to create objects of child forms.
Try this sample code and i hope u success. if my code helps please mark as a accept answer.
Thanks.
Dipa AhujaRank #1,168 · 1.5K reputationPosted Apr 26, 2010, 4:40 AM EDT
vedran16 reputationPosted Apr 26, 2010, 8:40 AM EDT
It works on other forms. Thank you for your answers, I will try to figure out this problem.
mjk pradeep8 reputationPosted Apr 29, 2010, 5:15 PM EDT
Menu menu = new Menu(); //Correct menu.show(); //Error -- u can't use show dialogue try this.., Rename Menu menu menu menu1 = new menu(); //Correct menu1.show(); //Correctvedran16 reputationPosted Apr 29, 2010, 10:27 PM EDT
:)