Solved

black text appears in the shaded box?

Posted on 2002-04-08
7
309 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
Comment Utility
I mean, how do I print the black text in the shaded box on the paper.
0
 
LVL 18

Expert Comment

by:Crash2100
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 18

Expert Comment

by:Crash2100
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Moving to the PAQ

kb
Experts Exchange Moderator
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now