Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Printing String Grids

Hello All
I got a very nice piece of Delphi code the other day from the web, http://www.tipps.delphi-source.de/oberflaeche/tut20030208-4.shtml
I needed to print out the contents of a String Grid, this works great, but I want to know if anyone knows how to print the lines as well which are around the cells.

So what I want to do is to print an exact copy of the String grid (except the Colour) and all its cells and the lines around the cells.

Thanks in advance
Steve

stevenriley@btopenwolrd.com

Comments

  • zibadianzibadian Posts: 6,349Member
    : Hello All
    : I got a very nice piece of Delphi code the other day from the web, http://www.tipps.delphi-source.de/oberflaeche/tut20030208-4.shtml
    : I needed to print out the contents of a String Grid, this works great, but I want to know if anyone knows how to print the lines as well which are around the cells.
    :
    : So what I want to do is to print an exact copy of the String grid (except the Colour) and all its cells and the lines around the cells.
    :
    : Thanks in advance
    : Steve
    :
    : stevenriley@btopenwolrd.com
    :
    You need to add this line into the i-j for-loops at the end of the page printing:
    [code]
    Printer.Canvas.Rectangle(XPos, YPos, XPos+Grid.ColWidths[J]*3, YPos+ZeilenSize);
    [/code]
    This should draw a rectangle around the cell, although I'm not sure. Here is a way to make a print-preview: place a TPaintBox onto a form and copy the print-code into a second event (a button or menu item OnClick for example). Then change the word Printer into the name of the paintbox. This will "print" the last page onto the paintbox. If you want to preview the other pages, just remove the p for-loop and let the users select a page index "P".
Sign In or Register to comment.