Solved

Dynamic Components...

Posted on 2002-05-02
3
229 Views
Last Modified: 2010-04-04
Hello,

    I need to create serveral TPanel components during run-time.

I've read up on doing this, and can get the components to create and display, using :

private
    ClassRef := TControlClass;

... ...
... ...

procedure TMainForm.setup(Sender: TObject);
var    newPanel : TControl;
begin
    classRef := TPanel;
    newPanel := classRef.Create(self);
    newPanel.Visible := false;
    newPanel.Parent := theGroupBox;
    ... ...
    -- property setups --
    ... ...
    newPanel.visible := true;
end;

... though, in a loop to create more than one, obviously.

Thing is, for example, the "Color" property isn't accessable for the dynamically created objects.

I can set the "top", "left", "width", "height"... etc. properties, but stuff like the bevel and color settings aren't accessable.

How would I manage to be able to set the new component colours, and stuff?
0
Comment
Question by:nicey
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Cesario earned 50 total points
Comment Utility
Try with (Classref as tPanel).Bevel.....


good luck

cesario
0
 
LVL 1

Author Comment

by:nicey
Comment Utility
Nice one.

That is very much appreciated.  It Works A Treat.

Cheers mate. ;-)
0
 
LVL 8

Expert Comment

by:Cesario
Comment Utility
Thanx ;-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now