Solved

Dynamic Components...

Posted on 2002-05-02
3
230 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
ID: 6987373
Try with (Classref as tPanel).Bevel.....


good luck

cesario
0
 
LVL 1

Author Comment

by:nicey
ID: 6987387
Nice one.

That is very much appreciated.  It Works A Treat.

Cheers mate. ;-)
0
 
LVL 8

Expert Comment

by:Cesario
ID: 6987390
Thanx ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

24 Experts available now in Live!

Get 1:1 Help Now