Вниз
Скачать: 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.45 MB
Время: 0.024 c
2-1128682889
Pasha L
2005-10-07 15:01
2005.10.30
Измениьт титл окна


2-1128513848
Vladimir88
2005-10-05 16:04
2005.10.30
Вещественные числа


14-1128793787
Layner
2005-10-08 21:49
2005.10.30
Обновление программы


5-1105538103
AlexG
2005-01-12 16:55
2005.10.30
Свойство компонента только для чтения...


2-1128817720
azard
2005-10-09 04:28
2005.10.30
создание типов данных




   Наверх