![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Шрифт в ListBox'е
Washington © (2007-10-30 15:02:00)Как сделать, чтобы при щелчке на ListBox'e шрифт выделенного элемента менялся?
Джо (2007-10-30 15:18:00) [1]Style := lbOwnerDrawFixed
И в обработчике OnDrawItem:
begin
with TListBox(Control).Canvas do
begin
if odSelected in State then
begin
Brush.Color := clActiveCaption;
Font.Color := clHighlightText;
Font.Name := 'Arial'
end
else
begin
Brush.Color := clWindow;
Font.Color := clWindowText;
Font.Name := 'Times New Roman'
end;
ListBox1.Canvas. FillRect (Rect);
TextOut(Rect.Left,Rect.Top,TListBox(Control).Items[Index]);
end;
end;