Solved

Print RichTextBox spacing problems

Posted on 2004-08-25
6
297 Views
Last Modified: 2012-08-13
I print out a RichTextBox, Its usually about two A4 pages. On the computer screen It looks all equally spaced, that means even if there is a kind of table with columns and rows the entries are in the right position.
When I print it the layout changes and it is hard to identyfy tables in the text.
I think it is related to the fact that spaces are interpreted differently, or perhaps to the fact that there is no equal distance for each character.

Does anyone have an idea how to takle this problem??????

To print I used a code example on the internet:
http://www.freevbcode.com/ShowCode.Asp?ID=195

In general this works very good except of the mentioned problem
0
Comment
Question by:themroc
  • 4
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
x50Fade earned 300 total points
Comment Utility
Yup.....this has also caused a lot of pain for me at one stage...

The problem is your font.....Try setting your font on the rich textbox to Lucida Console...

It's not such a nice font but your tabbing will work great and everything should be aligned the same way while running and while printed.

Hope this helps

P.S. Maybe there are some other fonts that also keeps tabbing and other stuff ok, but I have never really looked for another one as Lucida Console works just fine for me
0
 
LVL 2

Expert Comment

by:x50Fade
Comment Utility
Another thing.....

That's quite a long way to print from a rich textbox...and I bet it works great......but I normally just do the following:

1) I write whatever I want printed to a file, using tab(n); etc
2) Open the file in the rich textbox (rtfbox1.loadfile "filename")
3) Print the data in the textbox (trbox1.sellprint Printer.Hdc)
0
 

Author Comment

by:themroc
Comment Utility
That really does the job, thanks a lot!!!
But I have only one Question remaining maybe you can help

This font is this installed on every machine runing under windows or is there the danger that I want to print a font which does not exist and than caus an error???
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 2

Expert Comment

by:x50Fade
Comment Utility
Yup, there is the danger.... but Lucida Console is allways installed with any default Windows installation....

Tried and tested with win98 to winxp

Cheers
0
 

Author Comment

by:themroc
Comment Utility
thanks,
here are the points
>)
0
 
LVL 2

Expert Comment

by:x50Fade
Comment Utility
Thanks......

My first Points......I shall conquer this area...one-day!
0

Featured Post

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).

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

13 Experts available now in Live!

Get 1:1 Help Now