Windows Develop Bookmark and Share   
 index > Windows Forms General > Child and Parent Form
 

Child and Parent Form

Hi.

In a mdiparent form that have some child form,i want to manage controls on mdiparent form.

for example:A label is on mdiparent form; and i want to change text of it.

help me.

Pooneh  Monday, January 23, 2006 1:43 PM

I cant' understand... you want change from child?

Else you can change normally...

manuel0081  Monday, January 23, 2006 1:46 PM

child form is active! for example: by clicking on a botton in child form, the text of label in mdiparent is changed!

Pooneh  Monday, January 23, 2006 1:51 PM

I'm not expert but...

You can do in javascript of the child

SCRIPT = "<script language='javascript'> opener.location.href='parent.aspx?text=" + str + "';</script>"
RegisterStartupScript("parentwindow", SCRIPT)
Response.Write("<script>window.close();</script>")

... or...

if in parent you have written:

frmChild frm = new frmChild();

frm.MdiParent = this;

frm.Start();

 

then in child you can access parent from this.MdiParent o Parent o Owner... is it true?

manuel0081  Monday, January 23, 2006 2:15 PM

no,no,no.....

in child form:

void ... button1_click(....)

{

mdiparent.label1.text="HI";

}

OK?

controls in mdiparent not available to modify them!!!!

TNX.

Pooneh  Monday, January 23, 2006 2:25 PM

Maybe is your control private? How are you opening the child?

 

In Child form: public frmParent mydad;

In Parent form: form.mydad = this;
                       form.Show();

 

 

or with Global Variable...

manuel0081  Monday, January 23, 2006 2:36 PM

You can use google to search for other answers

Custom Search

More Threads

• Possible to store a CSV file as a resource embedded in an .exe?
• Client Application Service
• Question with Outlook and moving attached items
• compare strings with numeric values
• Showing forms
• ListView - how to add arrows in column header for sorting descending and ascending?
• MDI
• RUNNING WINDOWS PROGRAMS IN A SPLIT CONTAINER
• Check For Data Duplication using Object
• mouse click +image+C#