[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Dynamic Components...

Posted on 2002-05-02
3
Medium Priority
?
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Cesario earned 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 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