C# Parent Form Question.

Balthazar

Golden Member
Apr 16, 2000
1,834
0
0
Ok, so I have a C# app that has multiple forms, but what I want is lets say I have form a open, and I hit a button on it to open form b, how can I make it so where form a is "attached" to form b. Get what i'm saying? So there is only one item in the taskbar, and clicking on it brings both form a and form b to the foreground.

TIA

-Balthazar-
 

KB

Diamond Member
Nov 8, 1999
5,406
389
126
There isn't a way I know of to get 2 forms to come into the foreground "attached". You can use MDI forms or Dialog forms but they won't do what you are asking as you can only manipulate one form at a time. What I would do is make the two forms into one by putting all of the controls onto seperate panels of a single form. Then you can hide panel2 until you want to see it.
 

dgm

Member
May 10, 2004
30
0
0
Code:
Form2 childForm = new Form2();
childForm.ShowDialog();

That'll give you a modal dialog.
 

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
I believe what you are looking for is MDI forms (Dont know if C# supports, i'd imagine it would)

Dim frmChild as new frm
Dim frmParent as new frmMain
frmParent.MDIParent = true
frmChild.MDIParent = frmParent (me/this)

Thats VB syntax like, it'd be very similar in C#