Article View: borland.public.cppbuilder.nativeapi
Article #548Re: Create VCL Control from within an Object
From: Asger Joergensen
Date: Thu, 31 Jan 2008 18:55
Date: Thu, 31 Jan 2008 18:55
40 lines
2221 bytes
2221 bytes
Hi JohnC
JohnC says:
> Table = new TStringGrid(Parent);
> Table->Left = 0;
> Table->Top = 0;
> Table->Width = 443;
> Table->Height = 181;
Table->SetBounds(0,0,443,181);
is faster.
> And here is the call from the main:
> //---------------------------------------------------------------------------
> void __fastcall TMainForm::FormCreate(TObject *Sender)
> {
> ColorTable = new TJMCColorTable(MainForm);
> }
> //---------------------------------------------------------------------------
You should not use FormCreate when You are working with
BCB, it is a Delphi Event.
Use the constructor instead.
Or if You want the aplication to be fast on screen You
can use a TTimer set to 50 miliseconds that You enable
in the OnShowEvent.
Then You create Your colortable in the TimerEvent.
To be able to use the designer You could also build everything
on a panel at design time and then just make it invisible when
You don't need it.
Or You can create an extra form, with BorderStyle = bsNone;
Take it of the autocreate list and then when You need it
You create it with new just like Your TJMCColorTable.
and use Show(); when You want to see it.
Kind regards
Asger
Technical Details
Message-ID:
<MPG.220c37f435e9dd16989a27@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news2.euro.net!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47a1c92f$1@newsgroups.borland.com> <MPG.220bf5123600e831989a26@newsgroups.borland.com> <47a1e5d8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,15058af8c1208ee6 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Asger Joergensen <junk@Asger-P.dk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Create VCL Control from within an Object Date: Thu, 31 Jan 2008 19:55:08 +0100 Message-ID: <MPG.220c37f435e9dd16989a27@newsgroups.borland.com> References: <47a1c92f$1@newsgroups.borland.com> <MPG.220bf5123600e831989a26@newsgroups.borland.com> <47a1e5d8$1@newsgroups.borland.com> Organization: Asger-P MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 NNTP-Posting-Host: 83.73.220.89 X-Trace: newsgroups.borland.com 1201805827 83.73.220.89 (31 Jan 2008 10:57:07 -0700) Lines: 40 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news2.euro.net!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail