That's exactly what I ended up doing!  All of the methods I tried
which supposedly would estimate the required width for each column based on
the text entered were a disaster.  Another way I was successful was to
create a bmp and take a screen shot of the window...which is full-screen all
the time anyway...and then send that to the printer's canvas.  

>From "Robert Meek" 
Personal e-mail:  [EMAIL PROTECTED]
dba / "Tangentals Design"
Visit us at:  www.TangentalsDesign.com
Home of "The Keep"!

Member of:  "Association of Shareware Professionals"
Moderator for:  "The Delphi", "Delphi-DB", and "Delphi-Talk"
programming lists at elists.org, and "DelphiTalk.net"
at www.DelphiTalk.net


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Mick Arundell
Sent: Wednesday, March 30, 2005 6:44 PM
To: [email protected]
Subject: RE: Delphi Digest, Vol 26, Issue 40

> Date: Wed, 30 Mar 2005 02:20:51 -0500
> From: "Robert Meek" <[EMAIL PROTECTED]>
> Subject: StringGrids D2005
> To: <[email protected]>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain;     charset="us-ascii"
>
>       Although I've done a lot of work with DBGrids I've not up until now
> ever had need to use a TStringGrid, and as much as they are alike I'm
> surprised at many of the differences...some of which have me a little
> baffled!
>       For example, although one can set the columns up so that the user
> can alter their individual widths at runtime, I have not been
> able to find a
> way of storing this info back into an ini-file so that these
> settings can be
> retained and used again in future sessions.  Is this possible?  If so how,
> because the StrGrid.Col[0] doesn't have a width property...only a default
> width that sets all of them the same including the fixed column!
>       Also, I was under the impression I could store a stringgrid with any
> string info it's cells contain, including that in it's fixed columns, to a
> text file and then load the stringgrid back up with that same
> info directly
> from the file.  It seems the individual column text can be saved that way
> but not all in one file.  How is this handled?
>       Finally, Because this particular grid will be used by a restaurant
> manager to set her waitress's working hours, I need to be able to print a
> copy of the grid out in landscape format after she has made all
> the entries
> for a particular week.  I don't want a print screen because that
> would show
> the entire form...just the grid itself.  How can this best be
> accomplished?
>
> >From "Robert Meek"
> Personal e-mail:  [EMAIL PROTECTED]
> dba / "Tangentals Design"
> Visit us at:  www.TangentalsDesign.com
> Home of "The Keep"!
>
> Member of:  "Association of Shareware Professionals"
> Moderator for:  "The Delphi", "Delphi-DB", and "Delphi-Talk"
> programming lists at elists.org, and "DelphiTalk.net"
> at www.DelphiTalk.net
>
>
>
>

Hi Robert,
Try Grid.ColWidths[Index : integer];

To print use PaintTo, though you will get far better results if you generate
a suitably size Grid on your printer's canvas at Print time
It is only iterative after you've determined some multipliers.

As for loading to or from a stream perhaps you could stream the component.

Other wise save/reading is an iterative process

You might want to sub class to make your own

Mick


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to