Print a MSFlexGrid: the simplest way
By: Lorenzo Dalla Vecchia Date: 16/07/2001

A very common question I receive is how to print a MSFlexGrid. Usually people create long code blocks to accomplish this task.
However, there is a very easy, yet unknown, way to print a MSFlexGrid:

Printer.PaintPicture MSFlexGrid1.Picture, 0, 0

Replace MSFlexGrid1 with the actual name of the FlexGrid. The Picture property returns an image representation of the grid, and the latter can be printed with the PaintPicture method of the standard Printer object.

Remember that this code works only with grids that fit into a signle page. If you want a complete code that prints on multiple pages, check Print a MSFlexGrid.

Click Here!

Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
To contact the Webmaster, click here.
Hosted by InWind: