Solved

Print RichTextBox spacing problems

Posted on 2004-08-25
6
332 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
[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
  • 4
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
x50Fade earned 300 total points
ID: 11899926
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
ID: 11899953
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
ID: 11901784
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:x50Fade
ID: 11910124
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
ID: 11931440
thanks,
here are the points
>)
0
 
LVL 2

Expert Comment

by:x50Fade
ID: 11931546
Thanks......

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

623 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