Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB
Expertise: Intermediate
Jul 11, 2006

Printing Color Lines in VB

Have you ever had a problem printing lines in color from VB6 (SP4)? The following code works correctly on a PictureBox, but prints black on the Printer (HP LaserJet and Lexmark):

    Object.ForeColor = vbRed
    Object.Line (X1, Y1)-(X2, Y2)    ' red on PictureBox, black on Printer
    Object.Print "Text"              ' ok on both PictureBox and Printer
The solution is to add the following color argument to your statement:
 
    Object.ForeColor = vbRed
    Object.Line (X1, Y1)-(X2, Y2), vbRed  ' ok on both PictureBox and Printer
    Object.Print "Text"                   ' ok on both PictureBox and Printer
Swaminathan Raghavan
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap