Click here to Skip to main content
15,742,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends, my project(custom word processor) has a richtextbox that opens in a form as a document for typing text and saving. From the properties of the richtextbox I can get the number of lines typed in by the user. The problem I have now is inserting page breaks as in Microsoft Word so that after a certain number of lines reached the Richtextbox can break page and start on a new page below. Also i would like to know the number of pages consumed by the typed text so that i can display it on the status bar below. Please any help on this, either code or ideas will be greatly appreciated. Thank you.
Updated 26-Jun-17 10:07am

Printing is basically drawing... when you print, you have to handle drawing the content to a canvas to be output on the printer page by page. Here is a link to an existing aritcle that deals with printing what is in a richeditbox... may be a good starting point for you.

Simple Printing Aritcle [^]
Share this answer
How about adding a form feed? In VB that would be chr(12). You will not see that in a Rich Text Box, but it will appear if you open the file in Word or if you print it. That has worked in my application.
Share this answer
Dave Kreskowiak 26-Jun-17 16:10pm    
You're only SIX YEARS too late to the discussion.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900