🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2190

Re: WindowState = wsMaximized

#2190
From: Vladimir Stefanovic
Date: Tue, 24 Apr 2007 15:51
35 lines
1895 bytes
> I have added WindowState = wsMaximized to the OnShow()
> event,

OnShow() is not the best place for that. Move that code in the
Constructor insted.


> which does look like the form is maximized (the maximize
> button is disabled and the other is not) however, the form is
> movable. I can restore the size of  the app and then click the
> maximize button and then the form is  maximized and unmovable.
> How do I mimic that operation in some startup code, line
> OnShow?

Do you have some dialogs in OnActivate or similar?


Also, note that OnShow and OnActivate can be exectuted more
that once, so you need some additional code like this, to avoid
multiple execution ofsome parts of code:

void __fastcall TForm1::FormShow(TObject *Sender)
{
   static bool HasPassedOnceOnShow = false;
   if ( ! HasPassedOnceOnShow )
   {
      HasPassedOnceOnShow = true;
      WindowState = wsMaximized
   }
}


-- 
Best Regards,
Vladimir Stefanovic 
Technical Details
Message-ID: <462e278d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <462e1003$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8a1d45dff409ee34
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <462e1003$1@newsgroups.borland.com>
Subject: Re: WindowState = wsMaximized
Date: Tue, 24 Apr 2007 17:51:41 +0200
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 87.116.181.111
Message-ID: <462e278d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1177429901 87.116.181.111 (24 Apr 2007 08:51:41 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail