Вниз
Скачать: 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.028 c
14-1128501028
MBo
2005-10-05 12:30
2005.10.30
Ветка об $ALIGN


14-1129120736
CHES
2005-10-12 16:38
2005.10.30
Помогите с переводом


2-1128439767
Sysanin
2005-10-04 19:29
2005.10.30
Уменьшение размера exe


1-1128926770
Zhekson
2005-10-10 10:46
2005.10.30
Полоса прокрутки в DBGrid


14-1128617265
Kinder_
2005-10-06 20:47
2005.10.30
Что можно почитать про оптимизацию кода ?




   Наверх