Solved

Print RichTextBox spacing problems

Posted on 2004-08-25
6
312 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
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

770 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