How to set the Row Height and row background color of the DBGrid header row, the selected record row, and the column width Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061216115412271.html
RT
1. Columns attributes
2. ondrawcolumncell event
Procedure tform1.dbgrid1drawcolumncell (Sender: tobject; const rect: trect;
Datacol: integer; column: tcolumn; State: tgriddrawstate );
VaR I: integer;
Begin
If gdselected in State then exit;
For I: = 0 to (sender as TDBGrid). Columns. Count-1 do
Begin
(Sender as TDBGrid). Columns [I]. Title. Font. Name: = 'body ';
(Sender as TDBGrid). Columns [I]. Title. Font. Size: = 12;
(Sender as TDBGrid). Columns [I]. Title. Font. Color: = clnavy;
(Sender as TDBGrid). Columns [I]. Title. Color: = $00ffc4c4;
End;
If query1.recno mod 2 = 0 then
(Sender as TDBGrid). Canvas. Brush. Color: = clinfobk
Else
(Sender as TDBGrid). Canvas. Brush. Color: = RGB (191,255,223 );
Dbgrid1.defadrawcolumncell (rect, datacol, column, State );
With (sender as TDBGrid). Canvas do begin
Pen. Color: = $00ff0000;
MoveTo (rect. Left, rect. Bottom );
Lineto (rect. Right, rect. Bottom );
Pen. Color: = clteal;
MoveTo (rect. Right, rect. Top );
Lineto (rect. Right, rect. Bottom );
End;
End;
How to set the Row Height? How does one set the Row Height of the title?