Page 1 of 1

Closing a child frame - destructor

Posted: Mon Jul 11, 2011 3:01 pm
by eriX
Hello,

I have some little trouble with my childframes.

My main Window is called "StartFrm".

I call the childframe "ansehen" with the following code:

Code: Select all

ansehen *childframe = new ansehen(this); 
childframe->Show(); 
Show(false);
My main window is now hidden and "ansehen" appeared.

Now I want to show my "StartFrm" again and destroy the childframe "ansehen" completely.

How can I do this?

- Eric.

Re: Closing a child frame - destructor

Posted: Thu Jul 14, 2011 8:23 am
by eriX
No idea or a hint? It's very important...

Re: Closing a child frame - destructor

Posted: Thu Jul 14, 2011 8:37 am
by doublemax

Code: Select all

childframe->Destroy();
Show(true);
?

Re: Closing a child frame - destructor

Posted: Thu Jul 14, 2011 8:43 am
by eriX
Oh... :oops:

I've tested ->Destroy(); without Show(true);
Then my complete program was destroyed.

Thank you! :roll:

Re: Closing a child frame - destructor

Posted: Thu Jul 14, 2011 8:46 am
by doublemax
Please show some more code in context.

Re: Closing a child frame - destructor

Posted: Thu Jul 14, 2011 8:50 am
by eriX
childframe->Destroy();
Show(true);

Had worked as I said...


But how do I "parentframe->Show(true);" from the childframe without to create it again?

Re: Closing a child frame - destructor

Posted: Thu Jul 14, 2011 8:54 am
by doublemax
From inside the childframe, try:

Code: Select all

GetParent()->Show();

Re: Closing a child frame - destructor

Posted: Thu Jul 14, 2011 8:59 am
by eriX
Thank you very much.
Now everything is working well ;)