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

Вопрос по ListBox у   Найти похожие ветки 

 
Tolik   (2003-09-30 01:36) [0]

Вопрос значится такой: как в ЛистБоксе при свойстве Enable:=false поставить свой шрифт и цвет?


 
Zergling ©   (2003-09-30 08:25) [1]

var
EnF: TFont;
DeF: TFont;

// *******

EnF := TFont.Create;
with EnF do
begin
Color := clRed;
// ...
end;
DeF := TFont.Create;
with DeF do
begin
Color := clBlue;
// ...
end;

// *********

Style := lbOwnerDraw...
OnDrawItem
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
if (Control is TListBox) then
if (Control.Enabled) then (Control as TListBox).Canvas.Font := EnF else (Control as TListBox).Canvas.Font := DeF;
(Control as TListBox).Canvas.TextOut(Rect.Left, Rect.Top, (Control as TListBox).Items[Index]);
end;



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

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



Память: 0.44 MB
Время: 0.012 c
1-27492
AlexanderSK
2003-09-26 17:30
2003.10.09
Как подлучить список - расширение - приложение - иконка


3-27330
Vemer
2003-09-20 23:54
2003.10.09
Interbase 7.0 + Delphi 6 + проблемы с русским языком


1-27435
Канарский
2003-09-28 12:47
2003.10.09
Принудительное закрытие файлов


14-27683
Alexia2
2003-09-22 10:40
2003.10.09
Что-то не получается!


14-27722
Карлсон
2003-09-20 18:45
2003.10.09
случайные и псевдослучайные числа.




   Наверх