471,610 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

Unhiding a form...

RSH
My form woes continue...I have a Parent form that hides itself when one if
it's child forms are spawned. My problem is that I need the child form to
unhide the parent form when it is being closed. I wired the closing even
already so I am trapping the event but I need to know what method to call to
unhide the Parent form:

on the Child Form:
this.ParentForm.UnHide???

Thanks!
Ron
Jan 3 '06 #1
5 2513
"RSH" <wa*************@yahoo.com> wrote in message
news:eJ**************@tk2msftngp13.phx.gbl...
My form woes continue...I have a Parent form that hides itself when one if
it's child forms are spawned. My problem is that I need the child form to
unhide the parent form when it is being closed. I wired the closing even
already so I am trapping the event but I need to know what method to call
to unhide the Parent form:

on the Child Form:
this.ParentForm.UnHide???

Thanks!
Ron


well if the child is *really* a child window of the parent (child and parent
have very specific meanings in Windows) then

this.Parent.Show():

However, if by parent you mean "the form that had code that showed this
other form" then there is no specified relationship between the forms. You
need to pass a reference to the parent form to the clid in childs
constructor or maybe more decoupled, have an event on the child that the
praent subscribes to that the child raises when it closes.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Jan 3 '06 #2

RSH wrote:
My form woes continue...I have a Parent form that hides itself when one if
it's child forms are spawned. My problem is that I need the child form to
unhide the parent form when it is being closed. I wired the closing even
already so I am trapping the event but I need to know what method to call to
unhide the Parent form:

on the Child Form:
this.ParentForm.UnHide???

Thanks!
Ron


Hm.

this.ParentForm.Visible = true;

might work?

Matt

Jan 3 '06 #3
Hi,

"RSH" <wa*************@yahoo.com> wrote in message
news:eJ**************@tk2msftngp13.phx.gbl...
My form woes continue...I have a Parent form that hides itself when one if
it's child forms are spawned. My problem is that I need the child form to
unhide the parent form when it is being closed. I wired the closing even
already so I am trapping the event but I need to know what method to call
to unhide the Parent form:

on the Child Form:
this.ParentForm.UnHide???


How are you showing your child window?
If you use ShowDialog then it's easy :

void ShowChildForm()
{
this.Hide();
new ChildForm().ShowDialog();
this.Show();
}

Otherwise, just pass a reference to the child window.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jan 3 '06 #4
Hi,

this.ParentForm.Visible = true;

might work?

Most probably not, see Richard post for a detailed description.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jan 3 '06 #5

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

this.ParentForm.Visible = true;

might work?

Most probably not, see Richard post for a detailed description.


Teach me to just scan the post. I was assuming he knew what the
"ParentForm" was. You are quite correct.

Matt

Jan 4 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by John | last post: by
5 posts views Thread by Richard Cornford | last post: by
4 posts views Thread by Targa | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.