Решил вопрос вот так. Сделал не сам, повзаимствовал с форума компонентов Alpha Controls:
| Код | type TMyDBGridEhStyle = class(TDBGridEhStyle)
public function HighlightDataCellColor(AGrid: TCustomDBGridEh; ACol, ARow: Integer; DataCol, DataRow: Integer; const Value: string; AState: TGridDrawState; InMultiSelect: Boolean; var AColor: TColor; AFont: TFont): Boolean; override; end;
var Form1: TForm1; MyStyle: TDBGridEhStyle;
implementation
function TMyDBGridEhStyle.HighlightDataCellColor(AGrid: TCustomDBGridEh; ACol, ARow, DataCol, DataRow: Integer; const Value: string; AState: TGridDrawState; InMultiSelect: Boolean; var AColor: TColor; AFont: TFont): Boolean; begin Result := inherited HighlightDataCellColor(AGrid, ACol, ARow, DataCol, DataRow, Value, AState, InMultiSelect, AColor, AFont); if Result and ([gdFocused] * AState = [gdFocused]) then AColor := Form1.sSkinManager1.GetHighLightColor(Form1.Focused);
end;
procedure TForm1.FormCreate(Sender: TObject); begin MyStyle := TMyDBGridEhStyle.Create(); DBGridEh1.Style := MyStyle; end;
|
|