Вниз
Скачать: 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.45 MB
Время: 0.026 c
9-1112788372
Gaiti
2005-04-06 15:52
2005.07.18
Problems with animation


3-1118236075
Cooper
2005-06-08 17:07
2005.07.18
Програмирование БД под MS SQL Server


14-1119607278
boriskb
2005-06-24 14:01
2005.07.18
Экономим на зарплатах?


4-1115398171
MrAndrey_ka
2005-05-06 20:49
2005.07.18
как обновить explorer & вызов окна выбора диалога


14-1118777623
Kerk
2005-06-14 23:33
2005.07.18
Кондуктора и не только...




   Наверх