Вниз
Скачать: CL | DM;

Прорисовка "детей"   Найти похожие ветки 

← →
slart ©   (2005-01-17 19:43) [0]

Как сделать, чтобы "дети" сразу прорисовывались? я делаю так:

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) [1]

GroupBox.Parent := Self;
Button.Parent := Self; // Или Button.Parent := GroupBox;

Переменные GroupBox и Button должны быть полями класса TSLPanel. Иначе - что произойдет, если положить на форму несколько таких компонентов?



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.079 c
1-1128267919
TStas
2005-10-02 19:45
2005.10.30
Как заставить доп. окно на панеле задач появиться?


2-1128605830
Толян
2005-10-06 17:37
2005.10.30
Массивы


14-1128532591
Greenz
2005-10-05 21:16
2005.10.30
Коды системных ошибок Windows


3-1127005901
quadronik
2005-09-18 05:11
2005.10.30
Добавление новых записей НЕ по команде.


14-1128501536
DelphiN!
2005-10-05 12:38
2005.10.30
Сколько часов в день вы уделяете непосредственно программированию




   Наверх