MSHFLEXGRID / MSFLEXGRID PRINTING PROBLEM - NEED HELP

  • 13 years ago

    Hi everyone

    I have a sub that print a large form (bigger then screen), everything on it print well EXCEPT the famous MSHFlexgrid and MSFlexgrid, they print the outside border only.

    the flexgrid is part of of the group Picture1.

    The Picture1.picture is a big BMP, there is 30 lables et Buttons in the group, all print well.

    My code is:

       Dim sWide As Single, sTall As Single
       Dim rv As Long

       Form1.ScaleMode = vbTwips   ' default
       sWide = 16
       sTall = 8.5   ' or 14, etc.
       Form1.Width = twipFactor * sWide
       Form1.Height = twipFactor * sTall
       With Picture2
          .Top = 0
          .Left = 0
          .Width = twipFactor * sWide
          .Height = twipFactor * sTall
       End With
       Form1.Visible = True
       DoEvents











       Picture1.SetFocus
       Picture2.AutoRedraw = True
       rv = SendMessage(Picture1.hwnd, WM_PAINT, Picture2.hDC, 0)
       rv = SendMessage(Picture1.hwnd, WM_PRINT, Picture2.hDC, _
       PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
       Picture2.Picture = Picture2.Image
       Picture2.AutoRedraw = False
       Printer.Orientation = 2
       Printer.Zoom = 65
       Printer.Print ""
       Printer.PaintPicture Picture2.Picture, 0, 0
       Printer.EndDoc
       DoEvents













    So Help is very much appreciated to correct the problem or even change the approach.

    Thanks in advance.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.” - Dennis Ritchie