Solved

black text appears in the shaded box?

Posted on 2002-04-08
7
332 Views
Last Modified: 2012-06-27
How do you print a shaded rectangle (box) containing black text by using Printer object? I don't want any API! Any ideas?
0
Comment
Question by:computer1000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Author Comment

by:computer1000
ID: 6926490
I mean, how do I print the black text in the shaded box on the paper.
0
 
LVL 18

Expert Comment

by:Crash2100
ID: 6926565
You could do something like this:

Printer.DrawWidth = 5
Printer.Line (50, 50)-Step(1440, 1440), , B

Printer.CurrentX = 500
Printer.CurrentY = 500
Printer.FontSize = 20
Printer.FontBold = True
Printer.Print "test"
0
 

Author Comment

by:computer1000
ID: 6926574
Yes I could do something like that above. I use my code below.

'Printer.DrawWidth = 5
'Printer.FillColor = &H808080
'Printer.FillStyle = 0
'Printer.ForeColor = vbBlack
'Printer.FontTransparent = True
'Printer.Print ""
'Printer.Print "Hello this is a test"
'Printer.Line (0, 500)-(1400, 200), &HC0C0C0, B
'Printer.EndDoc

It does not show a shaded box here. What's wrong with my code?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 18

Expert Comment

by:Crash2100
ID: 6926611
What do you mean by it doesn't show a shaded box, it doesn't print anything?  If so, it may be outside your printer's minimum margins.  Try this and see if it works.


Printer.DrawWidth = 5
Printer.FillColor = &H808080
Printer.FillStyle = 0
Printer.ForeColor = vbBlack
Printer.Line (0, 0)-(5000, 5000), &HC0C0C0, B

'Change the current x and y locations to where
'you want to print the text
Printer.CurrentX = 1500
Printer.CurrentY = 2500

Printer.FontBold = True
Printer.Print "Hello this is a test"

Printer.EndDoc
0
 
LVL 5

Accepted Solution

by:
bob_online earned 150 total points
ID: 6927864
I assume that your code is not really all commented out...


swap these two lines and try it...

Printer.Line (0, 500)-(1400, 200), &HC0C0C0, B
Printer.Print "Hello this is a test"

My guess is that the box is covering the text (and no, the text would not show through because the box command is replacing the "pixels" of the text with the lighter color.

I haven't tried this and may be wrong, but I do know that this how the printer object behaves.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7643055
Hi computer1000,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept bob_online's comment(s) as an answer.

computer1000, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7673280
Moving to the PAQ

kb
Experts Exchange Moderator
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month3 days, 23 hours left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question