RichText文档中的分页符 [英] Page break in RichText Document

查看:133
本文介绍了RichText文档中的分页符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,我的项目(自定义文字处理程序)有一个richtextbox,可以在表单中打开,作为输入文本和保存的文档。从richtextbox的属性我可以得到用户输入的行数。我现在遇到的问题是在Microsoft Word中插入分页符,以便在到达Richtextbox一定数量的行后可以中断页面并从下面的新页面开始。此外,我想知道键入的文本消耗的页数,以便我可以在下面的状态栏上显示它。请提供任何帮助,无论是代码还是想法都将不胜感激。谢谢。

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.

推荐答案

打印基本上是绘图...当您打印时,您必须处理将内容绘制到画布上以便逐页输出到打印机上。这是一个链接到现有的aritcle处理打印丰富的内容...可能是一个很好的起点。



简单打印Aritcle [ ^ ]
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 [^]


如何添加换页?在VB中,这将是chr(12)。您不会在富文本框中看到它,但如果您在Word中打开文件或打印它,它将出现。这在我的申请中有效。
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.


这篇关于RichText文档中的分页符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆