TIP: Click on subject to list as thread! ANSI
echo: delphi
to: ALL
from: JOAQUIM HOMRIGHAUSEN
date: 1997-11-20 11:48:00
subject: D1: TStringGrid column sizing

  Another thing (about TStringGrids).. I'm attempting to automatically size 
the individual columns (at run-time) of the grid.
  I do this by creating a string which is identical (of fixed width) to one 
that will be displayed once the grid has been created. I then use the 
GetTextExtent() call to figure out the width in pixels, and then tell TSG 
that column such and such should be of this width, it works for all columns 
with one exception:
  XS:=FormatDateTime('ddddd @ t', Now);
  The column that displays the above string is too large (by quite a lot - 
IMHO). I can't figure out why. The width of the column to the right of the 
one holding the above data is set by doing:
  XS:='999';
  And then doing the GetTextExtent() call.. and it is *precisely* that wide.
  ???
            %JoHo%
            joho@defsol.se
---
---------------
* Origin: Definite Solutions ~/Stockholm, Sweden (2:201/330.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.