Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 10:29

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 10 Jan 2022, 11:00 
Offline

Joined: 08 Jun 2013, 16:06
Posts: 10
when i used Amakrits style the bottom of the grin (unoccupied) are painted correctly
see Amakrits.png

when I use Metropolis green or blue the background area is white.
see Metropolis.png

how can I fix this color and make it - let say clRed...

thanks for advance


Attachments:
Metropolis green.PNG
Metropolis green.PNG [ 181.32 KiB | Viewed 652 times ]
Amakrits.PNG
Amakrits.PNG [ 132.87 KiB | Viewed 652 times ]
Top
 Profile  
 
PostPosted: 13 Jan 2022, 11:40 
Offline

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

You need to override TCustomGridEh.DrawEmptyAreaCell method

Code:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, MemTableDataEh, Db, DBGridEhGrouping, ADODB, GridsEh, DBGridEh,
  MemTableEh, ToolCtrlsEh, DBGridEhToolCtrls, StdCtrls, Mask, DBCtrlsEh,
  ObjectInspectorEh, SqlTimSt,
  DBLookupEh, DynVarsEh, DBAxisGridsEh, EhLibVCL, Vcl.Grids, Vcl.DBGrids;

type
  TDBGridEh = class(DBGridEh.TDBGridEh)
  protected
    procedure DrawEmptyAreaCell(ACol, ARow: Integer; ARect: TRect); override;
  end;

  TForm1 = class(TForm)
    MemTableEh1: TMemTableEh;
    DBGridEh1: TDBGridEh;
    DataSource1: TDataSource;
    ADOTable1: TADOTable;
    DBGrid1: TDBGrid;
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TDBGridEh.DrawEmptyAreaCell(ACol, ARow: Integer; ARect: TRect);
var
  AFillRect: TRect;
begin
  AFillRect := ARect;
  Canvas.Brush.Color := clRed;
  Canvas.FillRect(AFillRect);
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 49 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:  
cron
Powered by phpBB® Forum Software © phpBB Group