Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing using .printform in vb6 produces black in the datagrid

Status
Not open for further replies.

jcastill

Technical User
Jun 19, 2002
7
US
I am using .printform to print the form but am getting black in place of the datagrid.

I am printing to an HP LaserJet printer.
I have tried several different properties of the form in particular those that involve color without any success.

The code snippet that I last tried is as follows:

Dim Old_Color As String
Old_Color = grdArray.BackColorBkg
frmHoldRelease.BackColor = vbWhite
grdArray.BackColorBkg = vbWhite
frmHoldRelease.PrintForm
grdArray.BackColorBkg = Old_Color

Any Help on resolving this would be greatly appreciated.
TIA
John
 
I had the same problem with flex grids.

To get around this put a picture box on the form behind your grid and add some code like this:

Code:
    'Place contents of flex grids in picture boxes
    pbSample.AutoRedraw = True
    pbSample.Picture = fgSampleRS.Picture
    
    'Hide Flex grids
    fgSampleRS.Visible = False
    
    'Print Form
    Me.PrintForm
    
    'Re-Display Flex grids
    fgSampleRS.Visible = True
    
    'De-Activate picture boxes
    pbSample.AutoRedraw = False
 
Thanks for the tip! After getting a picture box setup for all the grids and fooling with positions I finally got it to work.

Thanks Again!
Much Appreciated

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top