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

NewComponent   Найти похожие ветки 

← →
Seldon   (2003-02-26 22:04) [0]

unit NewComponent;

interface

uses
SysUtils, Classes, Controls, StdCtrls;

type
TNewComponent = class(TCustomControl)
private
FButton: TButton;
FEdit: TEdit;
public
constructor Create(AOwner:TComponent); override;
published
property Button:TButton read FButton;
property Edit:TEdit read FEdit;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents("Standart", [TNewComponent]);
end;

{ TNewComponent }

constructor TNewComponent.Create(AOwner: TComponent);
begin
inherited;
FButton:=TButton.Create(Self);
FButton.Parent:=Self;
FButton.Name:="Button";
FButton.Top:=0;
FButton.Left:=0;
FButton.Width:=75;
FButton.Height:=25;
FEdit:=TEdit.Create(Self);
FEdit.Parent:=Self;
FEdit.Name:="Edit";
FEdit.Top:=25;
FEdit.Left:=0;
FEdit.Width:=75;
FEdit.Height:=25;
Width:=75;
Height:=50;
end;

end.

Проблема: Все изменения свойств Button и Edit, произведённые в DesignTime, не сохраняются в dfm файл и в RunTime. Подскажите в чём моя ошибка.
Спасибо.


← →
Романов Р.В. ©   (2003-02-26 22:30) [1]

Owner не форма по этому не сохраняется. В D6 у компонентов появился новый элемент в стилях (забыл как он называется), который указывает, что состояние компонента должно быть записано в dfm. Применяется как раз в таких случаях.


← →
Романов Р.В. ©   (2003-02-27 16:04) [2]

FButton.SetSubComponent(True);
FEdit.SetSubComponent(True);



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

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



Память: 0.45 MB
Время: 0.012 c
14-30048
Alexanders
2003-02-20 12:02
2003.03.10
Уровень записи


3-29711
lark
2003-02-18 06:00
2003.03.10
MS SQL Server 2000+ADO+Delphi6


3-29746
Wowa-K
2003-02-19 13:38
2003.03.10
StoredProc


9-29688
Jackson
2002-10-12 20:46
2003.03.10
Немного об ошибках


14-30080
Benbo
2003-02-21 01:13
2003.03.10
Библиотека VaClasses




   Наверх