open a new form that will added to an existing one...

  • Thread starter Thread starter oo
  • Start date Start date
O

oo

Hi all,
I am relatively new to .NET and C#.
I am trying to open an additional (new) form when a button is clicked
on an already existing form, but i want that this winform will be
added to the first winform (from Basic to advanced window).
How do i do this?
Thanks in advance
 
Hi,

I guess you want to create an MDI (Multiple Document Interface) form which
has it's child forms.
To do this, follow these steps:
1. set the IsMdiContainer property of the parent form to true.
2. Create your child form and set it's MdiParent property to the parent form.

HTH,
Rakesh Rajan
 
Thanks for the replay, but this is not what I meant.
My question is:
I want that the new form will be connected to the exiting form - that it
will look like it is the same form. Like a basic display and when I will
press a button I will get an advanced display (same border and when I
will change the size of one form the size of the other one will be
change automatically...)
I hope this is clearer
Waiting for your answer
Thanks again
 
Hi,

I guess you will have to do that programmatically. AFAIK there is no direct
method to do that.

You could easiliy have an instance in the second form and then manipulate
the first one. Won't that do?

HTH,
Rakesh Rajan
 
Hi,

If I understand you correctly you can do this by putting all controls for
one form on a single panel or container control (custom control) of your
choice and the controls for the other form on another panel/container. At
the click of the button, the panels will switch visibility, hiding one and
showing the other panel.

Happy Coding!
Morten Wennevik [C# MVP]
 
If you really want it to look like one form, then put all the information on
one form. It can start with the "advanced" controls hidden, and the form
size smaller so they don't show. Then on the click, show the hidden
controls, and change the size of the form so they will fit.

Yes, the advanced controls at least should be on their own panel (or
similar.) So you say something like foreach( Control c in panel1.Controls)
{ c.Show(); }
and also something like
Form1.Height += panel1.Height;
when you want to show the advanced information.

-Rachel

Morten Wennevik said:
Hi,

If I understand you correctly you can do this by putting all controls for
one form on a single panel or container control (custom control) of your
choice and the controls for the other form on another panel/container. At
the click of the button, the panels will switch visibility, hiding one and
showing the other panel.

Happy Coding!
Morten Wennevik [C# MVP]

osnat o said:
Thanks for the replay, but this is not what I meant.
My question is:
I want that the new form will be connected to the exiting form - that it
will look like it is the same form. Like a basic display and when I will
press a button I will get an advanced display (same border and when I
will change the size of one form the size of the other one will be
change automatically...)
I hope this is clearer
Waiting for your answer
Thanks again
 
Back
Top