Click here to Skip to main content
16,017,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all I have a parent Mdi form and three child forms

C#
frmTrnDialog objTrnDialog = new frmTrnDialog();
objTrnDialog.Owner = this;
           objTrnDialog.ShowDialog();

This is my code to set my child forms. But how to fit it perfectly inside parent form?
Posted
Updated 6-Nov-12 18:30pm
v2

Hi
try this:
C#
frmTrnDialog objTrnDialog = new frmTrnDialog();
objTrnDialog.show(this);

use this for child form:
C#
frmMain frm = this.Owner as frmMain;

(form parent=frmMain)
The point is, the components that form the Child You're Public
good luck,
Amir
 
Share this answer
 
Comments
Red Chocolate 7-Nov-12 1:14am    
thanks it worked but i have another problem how to fit my child form into a frame of parent form?
amirmohamad 7-Nov-12 2:19am    
First you in properties of parent form The true state of isMdicontainer to make changes and write this code to parent form:
FrmChild frm = new FrmChild();
frm.Show(this);
frm.TopLevel = false;
frm.Parent = this;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900