?
Solved

Print RichTextBox spacing problems

Posted on 2004-08-25
6
Medium Priority
?
337 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 1200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

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…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

719 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