![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Прорисовка "детей"
slart © (2005-01-17 19:43:00)Как сделать, чтобы "дети" сразу прорисовывались? я делаю так:
unit SLPanel;
interface
uses
SysUtils, Classes, Controls, ExtCtrls,StdCtrls;
var GroupBox:TGroupBox;
Button:Tbutton;
type
tSLPanel = class(TPanel)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
constructor Create(aowner:Tcomponent);override; //Êîíñòðóêòîð
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('SLComponent', [tSLPanel]);
end;
constructor TSlPanel.Create(aowner:Tcomponent);
begin
inherited create(Aowner);
GroupBox:=TGroupBox.Create(Self);
Button:=Tbutton.Create(Self);
end;
end.
Юрий Зотов (2005-01-18 05:25:00) [1]GroupBox.Parent := Self;
Button.Parent := Self; // Или Button.Parent := GroupBox;
Переменные GroupBox и Button должны быть полями класса TSLPanel. Иначе - что произойдет, если положить на форму несколько таких компонентов?