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

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

Наверх




Память: 0.47 MB
Время: 0.018 c
1-72394
Supreme
2003-01-13 14:25
2003.01.23
Только первый символ нужно сделать UpCase


8-72418
Yasha
2002-09-28 15:45
2003.01.23
Графика


3-72110
patrol
2002-12-30 16:51
2003.01.23
переключение раскладки клавиатуры при логоне к Ораклу


1-72270
Andy BitOff
2003-01-10 19:45
2003.01.23
Drag n Drop


3-72122
Alister
2002-12-31 02:46
2003.01.23
Как подключить Внешнюю компоненту 1С к своей DLL