• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Unexpected printer color shift

My app produces a rather complicated printout involving both graphics and text. The intention is to print in black only.  I have the following two statements in my Form_Load()

Printer.ColorMode = vbPRCMMonochrome
Printer.FillColor = &H808080

When using a color printer, there is one place in the code where the printed color shifts from black to light blue for all following calls to Printer.Line

I don't know why this happens, and would appreciate any suggestions.  Here is the code fragment where it happens:

Dim A As String*1 ' A=" ", or A="-", or A= something else

For I = 1 to ILIMIT
   --- compute various X,Y coordinates
   If A = " " Then
      Printer.FillStyle = 0
      Printer.Line (XA, YA)-(XB, YB),,B
   ElseIf A = "-" Then
      Printer.FillStyle = 1
      Printer.Line (BXA,BYA)-(BXB,BYA) ' ** this statement
                               triggers the color shift!
      Printer.Line (XA, YA)-(XB, YB),,B ' ** now this prints
                               in light blue, and also all
                            other Printer.Line statements
                            as we go round the loop.
      Printer.FillStyle = 1
      Printer.Line (XA, YA)-(XB, YB),,B
   End If
Next I

1 Solution
Use again the color init statement before the printer.line,
i hope it works.
posnormAuthor Commented:
Thank you! - Sometimes the VB printer object doesn't allow changing a property in mid-page.  Annoying.

Another solution to my problem is to specifically include vbBlack (if that's what is wanted) as:

printer.line (x1,y1)-(x2,y2), vbBlack, B

I still don't know why the color shift occurred, but as long as your suggestion (or mine) works, I'll worry about it some other time. I'd still like to know. -- Norm
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now