Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 13 Feb 2025, 19:59

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 02 Feb 2025, 09:18 
Offline

Joined: 02 Feb 2025, 08:39
Posts: 1
The default highlight color in DBGridEh is too light. If you need to adjust the highlight color, how can this be done by modifying the DBGridEh.pas file? In previous older versions, this was achieved by adjusting the function TDBGridEhStyle.HighlightDataCellColor. How can this be done in EhLib 10.2?


Top
 Profile  
 
PostPosted: 03 Feb 2025, 23:57 
Offline

Joined: 08 May 2014, 18:06
Posts: 695
Hello

You can override

procedure TDBGridEhStyle.GetSelectionBackgroundParams(Grid: TCustomDBGridEh;
IsActiveState: Boolean; var AColor: TColor; var ATransparencyLevel: Integer);

and assign new ATransparencyLevel for Highlighted cells

Like this:


Code:
unit MainFormUnit;
...
type
  TMyDBGridEhStyle = class(TDBGridEhStyle)
    procedure GetSelectionBackgroundParams(Grid: TCustomDBGridEh; IsActiveState: Boolean; var AColor: TColor; var ATransparencyLevel: Integer); override;
  end;

...
procedure TMyDBGridEhStyle.GetSelectionBackgroundParams(Grid: TCustomDBGridEh;
  IsActiveState: Boolean; var AColor: TColor; var ATransparencyLevel: Integer);
begin
  inherited GetSelectionBackgroundParams(Grid, IsActiveState, AColor, ATransparencyLevel);
  ATransparencyLevel := 150;
end;

....

initialization
  SetDBGridEhDefaultStyle(TMyDBGridEhStyle.Create(nil)).Free;
end.


_________________
Best regards
EhLib Support Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group