![]() |
|
|
|
|
#1
|
|||
|
|||
|
Для выделения строки в db grid я использую следующий код, но в Windows 2000 и Windows Vista при нажатии мышкой на строку текст в db grid становится белым. В Windows XP нормально.
Код:
type
TPeekAtCustomDBGrid = class(TCustomDBGrid);
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
//Выделяем цветом текущую строку
with TPeekAtCustomDBGrid(Sender) do
begin
if DataLink.ActiveRecord = Row - 1 then
Canvas.Brush.Color := clBtnFace
else
Canvas.Brush.Color := clWhite;
font.Color := clBlack; //Цвет текста
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end; |
|
#2
|
||||
|
||||
|
Код:
begin
with TPeekAtCustomDBGrid(Sender) do
begin
if DataLink.ActiveRecord = Row - 1 then
begin
Canvas.Brush.Color := clBtnFace;
canvas.font.Color := clred;
end
else
Canvas.Brush.Color := clWhite;
font.Color := clBlack;
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;второй раз исправил этот вроде полностью раб. Последний раз редактировалось pesi, 20.07.2009 в 16:20. |
|
#3
|
|||
|
|||
|
Огромное спасибо за помощь. Все работает как я и хотел
|