Link to home
Start Free TrialLog in
Avatar of QurbanDurrani
QurbanDurrani

asked on

Font size of the text in a DBGrid

Please look at the sql in the related question for more info. Basically I have made the column width to a fixed number(70). It is too small to hold the entire Ip address if each octet is 3 digits. So how can I make the text that appears in the cells smaller? I tried the following, but did not work:
procedure TDNSForm.GatewayGridDrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn;
  State: TGridDrawState);
begin
  if Column.Field.DataSet.RecNo = 1 then
  (Sender as TDBGrid).Canvas.Font.Color := clMedGray
  else
  //(Sender as TDBGrid).Canvas.Font.Size := 2; // This line did not work either
  Column.Font.Size := 4;
  GatewayGrid.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
ASKER CERTIFIED SOLUTION
Avatar of Thommy
Thommy
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of QurbanDurrani
QurbanDurrani

ASKER

Thanks Thommy. I have left work. I will give your suggestion a shot when I go back to work Monday morning.
SOLUTION
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your help guys.