🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #455

Re: Create form in IDE but minimize resources used?

#455
From: GB Blanchard
Date: Fri, 25 Oct 2002 17:30
26 lines
2127 bytes
On 24 Oct 2002 16:51:11 -0700, Saige Losli wrote:

> Hello,
> Is there a way to create forms using Borland's drag-and-drop IDE,
> yet not "instantiate" any controls on a tab until that tab is
> activated? Likewise, discard the controls when selecting a new tab.

 If I understand your question correctly, I think this is what you 
are looking for:

procedure TOptionsForm.PageControl1Change(Sender: TObject);
//To save resources with a TPageControl you can use the following 
TPageControl OnChange event handler:
//Put this in at top after interface: type TMyWinControl = 
class(TWinControl);
var
  i: Integer;
begin
  with Sender as TPageControl do
    for i := 0 to PageCount - 1 do
      if Pages[i] <> ActivePage then
        TMyWinControl(Pages[i]).DestroyHandle;
end; //PageControl1Change

====
Brad Blanchard
Technical Details
Message-ID: <VA.0000220e.00584685@spamcop.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!enews3
References: <6da8f140.0210241551.589e3324@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f973b,f1e819ed237d9a36
X-Google-Attributes: gidf973b,public
X-Google-Thread: fb0ea,f1e819ed237d9a36
X-Google-Attributes: gidfb0ea,public
X-Google-Thread: f973d,f1e819ed237d9a36
X-Google-Attributes: gidf973d,public
X-Google-Thread: 10baee,f1e819ed237d9a36
X-Google-Attributes: gid10baee,public
X-Google-ArrivalTime: 2002-10-25 10:54:17 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!enews3
From: GB Blanchard <1122@1122noexiste.net>
Newsgroups: comp.lang.pascal.delphi.misc,comp.lang.pascal.delphi.components.usage,borland.public.delphi.vcl.components.using,alt.lang.delphi
Subject: Re: Create form in IDE but minimize resources used?
Date: Fri, 25 Oct 2002 19:30:31 +0200
Organization: http://extra.newsguy.com
Lines: 27
Message-ID: <VA.0000220e.00584685@spamcop.net>
References: <6da8f140.0210241551.589e3324@posting.google.com>
Reply-To: 1122@1122noexiste.net
NNTP-Posting-Host: p-359.newsdawg.com
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Virtual Access by Atlantic Coast PLC, http://www.atlantic-coast.com/va