Вниз
Скачать: 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.025 c
3-1125466978
цук цук
2005-08-31 09:42
2005.10.30
Печать Rave Report


14-1128851569
NewWonder
2005-10-09 13:52
2005.10.30
Первые шаги в Java Script:


6-1121165312
DVYdm
2005-07-12 14:48
2005.10.30
Формирование TCP/IP пакета


14-1128718115
LordOfRock
2005-10-08 00:48
2005.10.30
Narod.Ru


5-1107759708
h010d
2005-02-07 10:01
2005.10.30
TreeView с колонками




   Наверх