How to print a StringGrid

This is a discussion on How to print a StringGrid within the C++ Programming forums, part of the General Programming Boards category; I hav a TForm with a StringGrid. How can I Print only the Grid. It works, when I use this ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    6

    How to print a StringGrid

    I hav a TForm with a StringGrid.
    How can I Print only the Grid.

    It works, when I use this code, but it's a little bit too small.

    StringGrid1->Enabled=false;
    Printer()->BeginDoc();

    StringGrid1->PaintTo(Printer()->Handle,10,10);

    Printer()->EndDoc();
    StringGrid1->Enabled=true;

  2. #2
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    TStringGrid does not have any printing functionality by default.

    You will need to either write you own code to take the contents of the cells and output them to printer, or find a third party VCL component which offers extended StringGrid functionality, namely print.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. merging linked lists
    By scwizzo in forum C++ Programming
    Replies: 15
    Last Post: 09-14-2008, 05:07 PM
  2. Personal Program that is making me go wtf?
    By Submeg in forum C Programming
    Replies: 20
    Last Post: 06-27-2006, 12:13 AM
  3. Scope And Parameter Passing
    By djwicks in forum C Programming
    Replies: 6
    Last Post: 03-28-2005, 07:26 PM
  4. What kind of programs should I start writing?
    By Macabre in forum C++ Programming
    Replies: 23
    Last Post: 04-12-2003, 08:13 PM
  5. Replies: 1
    Last Post: 07-31-2002, 11:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21