Вниз
Скачать: 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.015 c
1-27562
Lionzi
2003-09-29 15:38
2003.10.09
WindowMenu Tform


14-27640
Жук
2003-09-19 14:20
2003.10.09
Тяпница на дворе...


4-27780
Spawn
2003-08-03 16:20
2003.10.09
BitBlt


1-27547
starik30
2003-09-24 11:19
2003.10.09
Hint для Grid-a


3-27365
Dark Elf
2003-09-19 13:09
2003.10.09
Документация по ADO SQL




   Наверх