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

Вниз

Окантовка в ComboBox   Найти похожие ветки 

 
Atrion   (2004-12-21 09:48) [0]

Очень интересно как можно изменить вид окантовки при выделение строки в таком компоненте как ComboBox


 
Atrion   (2004-12-21 10:19) [1]

Вообщем сделал список с разноцветными строками (используя канву),только образовался один глюк - строки разного цветы выделяются разными по цвету окантовками....ну не ужели никто не знает как это сделать?


 
asvt   (2004-12-21 13:03) [2]


Procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
 Rect: TRect; State: TOwnerDrawState);
begin
 with TListBox(Control).Canvas do begin
   if odSelected In State then begin
     Brush.Color := clBlack;// Выделение черным
     Font.Color := clWhite;
   end
   else
     case index mod 4 of //четыре строки с чередованием
       0: begin
            Brush.Color := clRed;
            Font.Color := clWhite;
          end;
       1: begin
            Brush.Color := clAqua;
            Font.Color := clBlack;
          end;
       2: begin
            Brush.Color := clYellow;
            Font.Color := clBlack;
          end;
       3: begin
            Brush.Color := clLime;
            Font.Color := clBlack;
          end;
     end; { Case }

   FillRect(Rect);
   TextOut(Rect.Left +2, Rect.Top, TListBox(Control).Items[Index]);

   If odFocused In State Then Begin
     InflateRect(Rect, -1, -1);
     DrawFocusRect(Rect);
   End;  
 End;
end;
procedure TForm1.ListBox1MeasureItem(Control: TWinControl; Index: Integer;
 var Height: Integer);
begin
Height := (Control As TListbox).ItemHeight + 2;
end;



Piter Below (Team)


 
Atrion ©   (2004-12-22 12:27) [3]

Проверим  может и работает....Не знал что Font.Color влияет на цвет рамки выделяемого обькта...



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

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

Наверх




Память: 0.47 MB
Время: 0.047 c
1-1103703634
Симонова Ирина
2004-12-22 11:20
2005.01.09
AcrobatReader


14-1103189033
Кот Бегемот
2004-12-16 12:23
2005.01.09
Margaritas ante porcas


14-1103294319
Nat
2004-12-17 17:38
2005.01.09
Работа для программиста Delphi.


3-1102295375
Gene Green
2004-12-06 04:09
2005.01.09
Interbase Client/Server. Срочно нужна помощь.


1-1103537451
antonn
2004-12-20 13:10
2005.01.09
StringGrid и об екты.