BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SDI Forms: Minimize main but keep secondary open?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Brian
Guest





PostPosted: Tue Jun 28, 2005 3:04 pm    Post subject: SDI Forms: Minimize main but keep secondary open? Reply with quote




I have a SDI application that contains multiple forms. When I
minimize the main form, all secondary forms get automatically
minimized. Is there a way to keep uncouple the secondary forms from
the main form such that they stay open?

Each seconday form is auto created and shown via:

SecondaryFormX->Show();

I've also tried to not autocreate the form and manually create it
via

TSecondaryFormX *form=new TSecondaryFormX(MainForm);
form->Parent=MainForm;
form->Show();

Thanks in advance for your help.
Back to top
Hans Galema
Guest





PostPosted: Tue Jun 28, 2005 3:13 pm    Post subject: Re: SDI Forms: Minimize main but keep secondary open? Reply with quote



Brian wrote:
Quote:
I have a SDI application that contains multiple forms. When I
minimize the main form, all secondary forms get automatically
minimized.

Yes. That is completely normal.

Quote:
Is there a way to keep uncouple the secondary forms from
the main form such that they stay open?

Yes. Choose another mainform. That can be an empty TForm. Place it 'out of sight'
at startup. For instance. Left = Screen->Width; would do.

Quote:
Each seconday form is auto created and shown via:

SecondaryFormX->Show();

It is autocreated in WinMain ? They are set Invisible at designtime
and made visible with Show().

Quote:
I've also tried to not autocreate the form and manually create it
via

TSecondaryFormX *form=new TSecondaryFormX(MainForm);
form->Parent=MainForm;
form->Show();

Why are you asigning a Parent ? Now even if the Parent is not
the MainForm such children will minimize if the Parentwindow
minimizes.

Hans.

Back to top
JD
Guest





PostPosted: Tue Jun 28, 2005 4:58 pm    Post subject: Re: SDI Forms: Minimize main but keep secondary open? Reply with quote




"Brian" <bplotkin6 (AT) comcast (DOT) net> wrote:
Quote:

[...] Is there a way to keep uncouple the secondary forms
from the main form such that they stay open?

Yes but it means that each secondary form will have it's own
icon on the task bar. All you have to do is apply the
WS_EX_APPWINDOW flag to the Form's ExStyle and assign the
desktop as the parent. This is accomplished by overriding the
form's CreateParams method:

//--- in the header -------------------------------------------
protected:
virtual void __fastcall CreateParams( TCreateParams &Params );

//--- in the unit ---------------------------------------------
void __fastcall TForm1::CreateParams(TCreateParams &Params)
{
TForm::CreateParams( Params );
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = GetDesktopWindow();
}

~ JD


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Jun 28, 2005 5:16 pm    Post subject: Re: SDI Forms: Minimize main but keep secondary open? Reply with quote


"Hans Galema" <notused (AT) notused (DOT) nl> wrote


Quote:
Yes. Choose another mainform. That can be an empty TForm.
Place it 'out of sight' at startup. For instance. Left = Screen->Width;
would do.

Or just simply set the Application->ShowMainForm property to false before
Application->Run() is called.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.