Link to home
Start Free TrialLog in
Avatar of Arachn1d
Arachn1d

asked on

Printing from a FlexGrid

I want to print the contents of most of a flex grid (all but the top row),in addition to a heading (One line, large text), and column headings. The contents of the flexgrid and the column headings need to be aligned, and preferably I need divider lines between them. I have looked at the printer object but have had no success, particularaly in regards to positioning text. Help!
Avatar of Vbmaster
Vbmaster

Positioning text can be done using the .CurrentX and .CurrentY properties, for example if you want to position the text "What to type here" with the beginning at the coordinates (10 , 20) you just code..

Printer.CurrentX = 10
Printer.CurrentY = 20
Printer.Print "What to type here"

The printer object uses the same scale object model that any other control/form VB has, so to get the coordinates in something easier to understand you can set it to millimeters using code like

Printer.ScaleMode = vbMillimeters

If you add this code before the three code lines above you will get the "What to type here" string printed 10 mm from the left side of the paper and 20 mm from the top border of the paper.

Well not exactly 10mm and 20mm, printers do have a internal limitation so it might be 15mm and 25mm because the printer adds it's own margins to those values.
ASKER CERTIFIED SOLUTION
Avatar of waty
waty
Flag of Belgium 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 Arachn1d

ASKER

Thanks anyway, but I figured it out myself and forgot to delete the question. Here's the points anyway since your answer also seems to answer the question quite satisfactorially.

Thanks.