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

Составной компонент со списком.   Найти похожие ветки 

← →
ed30   (2004-07-15 19:33) [0]

Добрый день.

Создаю компонент, содержащий в себе ListBox и еще несколько других компонентов.

Как можно сделать, чтобы свойство Items вложенного в компонент ListBox было доступно в создаваемом компоненте и его можно было редактировать в DesignTime.

TListEditor = class(TWinControl)
 private
   FListEdit: TEdit;
   FListBox: TListBox;
   FAddButton: TBitBtn;
   FDelButton: TBitBtn;
   FClearButton: TBitBtn;
 protected
   procedure SetItems(Value: TStrings);
   function GetItems: TStrings;
   procedure SetText(Value: String);
   function GetText: String;
 public
   property ListEdit: TEdit read FListEdit;
   property ListBox: TListBox read FListBox;
   property AddButton: TBitBtn read FAddButton;
   property DelButton: TBitBtn read FDelButton;
   property ClearButton: TBitBtn read FClearButton;
   constructor Create(AOwner: TComponent); override;
   destructor Destroy; override;
 published
   property Items: TStrings read GetItems write SetItems;
   property Text: String read GetText write SetText;
 end;

При вызове редактора для property Items выдается ошибка.


← →
Юрий Зотов ©   (2004-07-15 19:47) [1]

procedure TListEditor.SetItems(const Value: TStrings);
begin
 FListBox.Items.Assign(Value)
end;

function TListEditor.GetItems: TStrings;
begin
 Result := FListBox.Items
end;


← →
ed30   (2004-07-16 10:03) [2]

Огромное спасибо



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

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



Память: 0.44 MB
Время: 0.029 c
3-1118149432
Prohodil Mimo
2005-06-07 17:03
2005.07.18
Правильная сортировка в FB в кодировке WIN1257


4-1116935485
Antonn
2005-05-24 15:51
2005.07.18
Синхронизация времени в Internet


3-1117914399
Inquisitor
2005-06-04 23:46
2005.07.18
как создать поле выбора в таблице


1-1119801165
Euro
2005-06-26 19:52
2005.07.18
Modal Form


1-1120124715
PIF
2005-06-30 13:45
2005.07.18
оператор case




   Наверх