PC Review


Reply
Thread Tools Rate Thread

Child Form variables postback to MDI Parent

 
 
=?Utf-8?B?UGhpbGlwcGU=?=
Guest
Posts: n/a
 
      15th Mar 2005
hi everybody,

I let the user enter values in a Child Form.
How can I post those values back to the MDIParent Form (which uses these
values) ?

By the way, is it possible to access Public MDIParent variables in a Child
Form ??

Help appreciated,

 
Reply With Quote
 
 
 
 
Bob Calvanese
Guest
Posts: n/a
 
      16th Mar 2005
One way would be to use properties. Or you could use return types in your
methods.

It really depends on what you are trying to do.

Bob Calvanese

"Philippe" <(E-Mail Removed)> wrote in message
news025F2D7-9241-42E2-BE8D-(E-Mail Removed)...
> hi everybody,
>
> I let the user enter values in a Child Form.
> How can I post those values back to the MDIParent Form (which uses these
> values) ?
>
> By the way, is it possible to access Public MDIParent variables in a Child
> Form ??
>
> Help appreciated,
>



 
Reply With Quote
 
coolzm
Guest
Posts: n/a
 
      16th Mar 2005
assuming you got 2 forms:
frmPost
frmInput (has public control "txtName" and "txtMail")
then in frmPost you can get value of "txtName"or"txtMail" by this:
private void btn_Click(object sender, System.EventArgs e)
{
frmInput myForm=new frmInput ();
myForm.ShowDialog(this);
this.user_name=myForm.txtName.Text;
this.user_mail=myForm.txtMail.Text;
}

"Philippe" <(E-Mail Removed)> дÈëÏûÏ¢
news025F2D7-9241-42E2-BE8D-(E-Mail Removed)...
> hi everybody,
>
> I let the user enter values in a Child Form.
> How can I post those values back to the MDIParent Form (which uses these
> values) ?
>
> By the way, is it possible to access Public MDIParent variables in a Child
> Form ??
>
> Help appreciated,
>



 
Reply With Quote
 
coolzm
Guest
Posts: n/a
 
      16th Mar 2005
and if you want to access Public MDIParent variables in a Child Form,you
should declare a public static variable in MDIParent:
public static bool hasChild;
then you can access it from Child:
MDIParent.hasChild=true;

----- Original Message -----
From: "Philippe" <(E-Mail Removed)>
Newsgroups: microsoft.public.dotnet.languages.csharp
Sent: Wednesday, March 16, 2005 7:57 AM
Subject: Child Form variables postback to MDI Parent


> hi everybody,
>
> I let the user enter values in a Child Form.
> How can I post those values back to the MDIParent Form (which uses these
> values) ?
>
> By the way, is it possible to access Public MDIParent variables in a Child
> Form ??
>
> Help appreciated,
>



 
Reply With Quote
 
Bob Calvanese
Guest
Posts: n/a
 
      16th Mar 2005
When working with objects you should not directly expose your member
variables. If that was not the case... Why not just make everything public?

--
Bob Calvanese
"Philippe" <(E-Mail Removed)> wrote in message
news025F2D7-9241-42E2-BE8D-(E-Mail Removed)...
> hi everybody,
>
> I let the user enter values in a Child Form.
> How can I post those values back to the MDIParent Form (which uses these
> values) ?
>
> By the way, is it possible to access Public MDIParent variables in a Child
> Form ??
>
> Help appreciated,
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot Reference Parent variables from a MDI Child Form Sandy Microsoft VB .NET 2 11th Mar 2008 10:09 PM
How does child class access parent's variables Goran Djuranovic Microsoft VB .NET 10 12th Apr 2006 11:07 PM
How to pass public variables from a parent to child ASCX John Cosmas Microsoft ASP .NET 1 29th Aug 2004 04:01 AM
Solution: Raising an Event Handler Postback on Parent Window From Popup Child Window Dialog Box Earl Teigrob Microsoft ASP .NET 1 16th Jun 2004 05:19 PM
MDI - how to open a child from a child within MDI parent form? Marina Neyman Microsoft Dot NET Framework Forms 0 7th Feb 2004 01:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:02 AM.