Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.10.09;
Скачать: 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 вся ветка

Текущий архив: 2003.10.09;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.018 c
1-27484
Эли
2003-09-26 19:55
2003.10.09
OpenDialog


1-27439
JOY
2003-09-28 06:04
2003.10.09
1Кто-нибудь пробовал выравнивать по ширине?


4-27790
Vlad451
2003-08-04 16:38
2003.10.09
Как указатель мыши представить в виде песочных часов


14-27634
Vik_mix
2003-09-23 11:03
2003.10.09
I(max) in COM-port


1-27523
Vitaliygavrilov
2003-09-26 11:18
2003.10.09
Как поместить иконку моей программы в меню