Главная страница
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.041 c
2-1131438558
DevMaster
2005-11-08 11:29
2005.11.27
TadvStringGrid (TMS) - проблемма с памятью


2-1131302018
ArtemESC
2005-11-06 21:33
2005.11.27
Дин.массивы


3-1129369145
AlexLines
2005-10-15 13:39
2005.11.27
Поиск в БД


2-1131566879
kami
2005-11-09 23:07
2005.11.27
Про QueryServiceConfig2 - _SERVICE_FAILURE_ACTIONS


1-1131006645
TUser
2005-11-03 11:30
2005.11.27
Уничтожение вложенных объектов