Solved

Dynamic Components...

Posted on 2002-05-02
3
232 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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