Solved

black text appears in the shaded box?

Posted on 2002-04-08
7
323 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
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

820 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