Главная страница
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.027 c
4-1127330070
марсианин
2005-09-21 23:14
2005.11.27
Как создать директорию?


2-1131520558
Al_Ba
2005-11-09 10:15
2005.11.27
Просто вопросик


2-1131714423
De1uxe
2005-11-11 16:07
2005.11.27
И еще


14-1131510557
DelphiN!
2005-11-09 07:29
2005.11.27
Отказ от курения, раздражительность


2-1131781771
lRunner
2005-11-12 10:49
2005.11.27
Как исправить крокозябры в Caption?