Solved

How do you define a FormFeed in a VB 6 RichTextBox?

Posted on 2001-08-28
5
241 Views
Last Modified: 2008-02-01
I can not find a way to get formfeeds to work in a VB 6 RichTextBox. I have created a .RTF file using Word 97 with page breaks defined but when loaded in the VB control they are ignored.

Does anyone know how to get this to work? If it is not supported,  does anyone know about a third party control that supports it?
0
Comment
Question by:BryanC
5 Comments
 
LVL 14

Expert Comment

by:wsh2
ID: 6433681
The RichTextBox is NOT a Printer and as such it has NO page length associated to it. So how you expect it to behave as such? If indeed, you want this type of functionality, then you will just have to hardcode it.
0
 

Author Comment

by:BryanC
ID: 6433846
You are correct, the RichTextBox is not a printer and unless I am mistaken, Microsoft Word is not a printer either. However, it does support such controls and I do want this type of functionality. That was the purpose of the question.
0
 
LVL 4

Expert Comment

by:mcoop
ID: 6434113
I suspect that muh like Word, it is the developer's responsibility to parse the attached RTF data to detect the FF, and other non-printing characters - then represent them in your own manner within the RTF box.

e.g. when you see a FF character - insert a CRLF, then a line of hyphens, then another CRLF... followed by the original RTF data.

Again - in your 'text editor' code, you would need to look for these structures, and skip over them - so the user doesn't corrupt the expanded interpretations you have made.

This may not be the only solution, but I suspect it is close - otherwise the RTF box would have to be incredibly complex to manage all language/font/punctuation variations.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 50 total points
ID: 6434265
BryanC

Wsh2 is correct and your comparison to Word is not relevant.  THe RichTextBox (unlike Word) does not have WYSIWYG printing built in.  You, the programmer, have to add that code.  This is by no means trivial and here is an article from MSDN that may help you understand a little of the complexity ahead of you:

HOWTO: Set Up the RichTextBox Control for WYSIWYG Printing (Q146022)

But to answer your question the RTF code for a hard page break is /page.  You can get more information on the RTF specs from the following article in MSDN:
Rich Text Format (RTF) Specification, version 1.6
It is about 100 pages and has all the information you need to code the printing of your document.

Good luck,
Anthony
0
 

Author Comment

by:BryanC
ID: 6442034
I thank you all for your input.

Anthony, the article you referenced was very good and I will try and use the information supplied in it to solve my problem. If anyone does come across another control that support more features than the Microsoft RichTextBox I would like to know.

Thanks,
Bryan
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

830 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