Solved

Dynamic Components...

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

732 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