Вниз
Скачать: 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.44 MB
Время: 0.013 c
3-72117
asmith
2002-12-27 19:18
2003.01.23
Нотификация в MS SQL Server


3-72073
Aleksandr
2003-01-05 17:05
2003.01.23
Directory is busy - это лечится как-нибудь?


3-72148
qwerty2
2003-01-03 17:21
2003.01.23
Размещение Band ов в QuickReport


14-72527
fgranit
2003-01-07 14:44
2003.01.23
Помогите запустить программу с таблицей PARADOX на другом компе


6-72429
Morfein
2002-11-22 01:00
2003.01.23
TCP/IP пакеты




   Наверх