Вниз
Скачать: 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.034 c
1-1130948246
ali_tash
2005-11-02 19:17
2005.11.27
Как закрывать пройденные записи в OracleDataSet


3-1129446032
__Пупкин
2005-10-16 11:00
2005.11.27
Можно ли узнать количество таблиц у SQL сервера


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


4-1127738702
NikNet
2005-09-26 16:45
2005.11.27
Как изменить стандартные диалоги? Открыть/Закрыть.


1-1130920256
Dgin
2005-11-02 11:30
2005.11.27
Как поднять у наследника метод?




   Наверх