Вниз
Скачать: 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 вся ветка

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



Память: 0.45 MB
Время: 0.031 c
14-1131228298
alexdrob
2005-11-06 01:04
2005.11.27
Браузер отображает не все страницы.


14-1131121160
psa247
2005-11-04 19:19
2005.11.27
Замена TaskManager


14-1130858704
PZ
2005-11-01 18:25
2005.11.27
Динамические массивы в Turbo Pascal


2-1131558243
San1
2005-11-09 20:44
2005.11.27
MP3


14-1131115835
ArtemESC
2005-11-04 17:50
2005.11.27
Загрузочный сектор




   Наверх