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
|
The problem is with the menu.show();
It is underlined in red with the following error.
|
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 rajuPosted Apr 26, 2010, 8:22 AM
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.
vedranPosted Apr 30, 2010, 2:27 AM
:)
mjk pradeepPosted Apr 29, 2010, 9:15 PM
vedranPosted Apr 26, 2010, 12:40 PM
It works on other forms. Thank you for your answers, I will try to figure out this problem.
Dipa AhujaPosted Apr 26, 2010, 8:40 AM