Article View: borland.public.cppbuilder.oodesign
Article #20Re: Delete and null a no modal form
From: Hans Galema
Date: Tue, 22 Jun 2004 19:02
Date: Tue, 22 Jun 2004 19:02
45 lines
2045 bytes
2045 bytes
Jose Manuel Tovar wrote:
> I have a main form (Form1) and when I press a button I create a new no modal
> form (Form2). In order to destroy Form2 I use "caFree".
How many Form2's do you allow to exist simultanously ?
> void __fastcall TForm1::btn_botonClick(TObject *Sender)
> {
// To allow only one Form2
if ( ! Form2 )
Form2 = new TForm2(Application);
// As Application is the Owner your
// Form will be deleted by TApplication
// at programm end
> Form2->Show();
> }
> void __fastcall TForm2::FormClose(TObject *Sender,
> TCloseAction &Action)
> {
> Action = caFree;
// Ok
> __fastcall TForm2::~TForm2()
> {
> Form2 = 0;
That is ok, provided you keep the caFree;
> I think this is possible but what happens with all the windows standard
> controls (labels, combos, etc ) defined in Form2?, are they destroyed
> automatically?
Yes. If the Form is destroyed the componets are destroyed too.
> Thanks in advance,
??
What kind of whitelineproducer do you happen to use ?
Hans.
Technical Details
Message-ID:
<40d8820d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40d85f31$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10db1e,113f95e7fbccde90 X-Google-Attributes: gid10db1e,public Date: Tue, 22 Jun 2004 21:02:40 +0200 From: Hans Galema <dontusethis@dontusethis.nl> User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.oodesign Subject: Re: Delete and null a no modal form References: <40d85f31$1@newsgroups.borland.com> In-Reply-To: <40d85f31$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 129.125.201.248 Message-ID: <40d8820d@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1087930893 129.125.201.248 (22 Jun 2004 12:01:33 -0700) Lines: 45 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail