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

Изменение цвета строки в ListBox`е   Найти похожие ветки 

← →
kofman ©   (2003-01-12 00:10) [0]

Мастера помогите, как в ListBox`е строку выделить цветом (скажем синим) и соответственно изменить цвет шрифта для данной строки (скажем на белый)? Заранее благодарю.


← →
БурЖуй ©   (2003-01-12 00:22) [1]

помниться делал както так:
TCheckListBox(Control).Canvas.Brush.Color := clgreen


← →
TTCustomDelphiMaster ©   (2003-01-12 01:04) [2]

TFiendListBox = class (TListBox);
...
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var
t: TDrawItemEvent;
begin
if Index = 3 then
begin
TListBox(Control).Canvas.Brush.Color := clGreen;
TListBox(Control).Canvas.Font.Color := clRed;
TListBox(Control).Canvas.Font.Style := [fsBold];
end;
t := TListBox(Control).OnDrawItem;
TListBox(Control).OnDrawItem := nil;
TFiendListBox(Control).DrawItem(Index, Rect, State);
TListBox(Control).OnDrawItem := t;
end;

И стиль у ListBox поставь в lbOwnerDrawFixed


← →
Song ©   (2003-01-12 10:34) [3]

http://pascal.sources.ru/cgi-bin/forum/YaBB.cgi?board=delphi;action=display;num=1037272197


← →
kofman ©   (2003-01-12 12:02) [4]

Всем большое спасибо.



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

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



Память: 0.45 MB
Время: 0.011 c
14-72539
Дмитрий К.К.
2003-01-07 06:26
2003.01.23
Именинники 7 января


1-72401
MyNameIsVova
2003-01-13 17:13
2003.01.23
Координаты курсора мыши.


1-72403
alecs
2003-01-13 17:47
2003.01.23
BarCode


1-72310
Кот Бегемот
2003-01-15 16:13
2003.01.23
Адрес процедуры - метод класса ?


3-72051
Tyke
2003-01-05 10:34
2003.01.23
Обновление записей в DataSet




   Наверх