Posted on 2002-05-02
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 :
ClassRef := TControlClass;
procedure TMainForm.setup(Sender: TObject);
var newPanel : TControl;
classRef := TPanel;
newPanel := classRef.Create(self);
newPanel.Visible := false;
newPanel.Parent := theGroupBox;
-- property setups --
newPanel.visible := true;
... 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?