Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.11.27;
Скачать: CL | DM;

Вниз

Выделение строк в ListBox е разными цветами   Найти похожие ветки 

 
Потёмкин   (2005-11-07 22:58) [0]

Подскажите, как реализовать сабж.


 
SpyBoy ©   (2005-11-08 00:13) [1]

Полгода назад меня тоже мучал этот вопрос:

var w,t,i1,i2:integer; o:string;
 begin
s:=edit1.Text;q:=length(s); kl:=strtoint(edit2.text);

 for i:=1 to q do begin
  if  (ord(s[i])) in [192..255] then
begin    t:=i; edit3.Text:=inttostr(t);
     with (Control as TListBox).Canvas do
     begin    if  Index=(i-1)then begin
     Font.Color:=clred; brush.Color:=clGradientActiveCaption; end; FillRect(Rect);
   TextOut(Rect.Left, Rect.Top, (Control as TListBox).Items[Index]);
end;
end else for i1:=1 to q do begin if(ord(s[i1])) in [65..122] then begin t:=i1; edit3.Text:=inttostr(t);
     with (Control as TListBox).Canvas do
     begin    if  Index=(i1-1) then begin
     Font.Color:=clgreen; brush.Color:=clyellow; end; FillRect(Rect);
   TextOut(Rect.Left, Rect.Top, (Control as TListBox).Items[Index]);
end; end;end;  for i2:=1 to q do begin
if ((ord(s[i2]))  in [0..64])or  ((ord(s[i2]))  in [123..191])
then begin
     with (Control as TListBox).Canvas do
     begin    if  Index=(i2-1) then begin
     Font.Color:=clblack; brush.Color:=clwhite; end; FillRect(Rect);
   TextOut(Rect.Left, Rect.Top, (Control as TListBox).Items[Index]);
end;
end;end;
for h:=1 to kl do begin
  with (Control as TListBox).Canvas do
 begin        // w:=4;
if  Index=w then
       begin
         Font.Color := clred;
         Brush.Color := clblue;
       end;

    end;
 b2:="...............rus";     end;end;
end;


P.S. А ты сам чего пишешь ?


 
Потёмкин   (2005-11-08 08:16) [2]

> SpyBoy ©   (08.11.05 00:13) [1]

Спасибо. Попробую.

Да так, эксперементирую... :)



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

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

Наверх




Память: 0.47 MB
Время: 0.051 c
5-1112022648
JenekX
2005-03-28 19:10
2005.11.27
Сохранение свойств компонентов в файл


1-1131006973
Ugrael
2005-11-03 11:36
2005.11.27
dbgrid и defaultdrawing


2-1131219086
Bkmz
2005-11-05 22:31
2005.11.27
Как отправить почту?


5-1103690701
_Zilog
2004-12-22 07:45
2005.11.27
Как заставить свой компонент реагировать на соьытия мыши


14-1130927187
Бугимэн
2005-11-02 13:26
2005.11.27
MS Office Outlook + NNTP