RichTextFormat Guru needed

G

Guest

I created a document in Word and saved it in RTF format. The document
consists of a title line, and two text lines. For the two text lines I did
paragraph spacing of 0 points before and 6 points after.

If I open this RTF file (formatted by Word) in either WordPad or a Windows
form (created in VB VS 2005) that contains an RTF control, all works well.
If I save the document from either the RTF control or from WordPad, the file
becomes considerably smaller (as expected) and the new file continues to work
well in WordPad when loaded in a new instance of WordPad. This is not true
for the RTF control.

If I load the file (As saved by WordPad or RTF control) into the RTF control
and do a keystroke sequence, strange behavior occurs. The strange behavior
occurs when I go to the end of Line #1, and enter the following keystrokes
(Enter)(Space)(Space)(Space) these keystrokes cause the text below it to
scroll down instead of remain stationary within the control. If I then type
any character, the text snaps back to the correct location. This behavior
does not occur in Word, WordPad, or the RTF control if the file was last
updated by Word.

This seems to be a bug in the RTF control. Can someone comment on this? Am
I missing something? This behavior is annoying but not a show stopper.
Below is the RTF file as created by WordPad.

{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}}
{\colortbl ;\red128\green0\blue0;}
{\*\generator Msftedit
5.41.15.1507;}\viewkind4\uc1\pard\nowidctlpar\qc\cf1\b\f0\fs36
Title\cf0\b0\fs24\par
\pard\nowidctlpar\sa120 Line #1\par
\par
Line #2\par
}
 
A

andreas

for loading the file have you set ?

..richtextbox1.LoadFile(fs, RichTextBoxStreamType.RichText)
where fs is a filestream



genojoe said:
I created a document in Word and saved it in RTF format. The document
consists of a title line, and two text lines. For the two text lines I did
paragraph spacing of 0 points before and 6 points after.

If I open this RTF file (formatted by Word) in either WordPad or a Windows
form (created in VB VS 2005) that contains an RTF control, all works well.
If I save the document from either the RTF control or from WordPad, the file
becomes considerably smaller (as expected) and the new file continues to work
well in WordPad when loaded in a new instance of WordPad. This is not true
for the RTF control.

If I load the file (As saved by WordPad or RTF control) into the RTF control
and do a keystroke sequence, strange behavior occurs. The strange behavior
occurs when I go to the end of Line #1, and enter the following keystrokes
(Enter)(Space)(Space)(Space) these keystrokes cause the text below it to
scroll down instead of remain stationary within the control. If I then type
any character, the text snaps back to the correct location. This behavior
does not occur in Word, WordPad, or the RTF control if the file was last
updated by Word.

This seems to be a bug in the RTF control. Can someone comment on this? Am
I missing something? This behavior is annoying but not a show stopper.
Below is the RTF file as created by WordPad.
{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\
fprq2\fcharset0 Times New Roman;}}
 
G

Guest

I was using Me.rtfUser.RTF = sTemp 'where sTemp is the content of the text
file.

I did try the following and got the same result. I did not think it would
make a difference but I tried it.

Dim fs As New FileStream("F:\PKA\PKAFiles\2000000648", FileMode.Open)
Me.rtfUser.LoadFile(fs, RichTextBoxStreamType.RichText)

Can someone try the file listed in the main note and verify the behavior?
It's a two minute job to create a form with an RTF box. You only need to
save the enclosed RTF file as text a text file then use the two lines above
in the Load procedure. Hopefully you will see what I see. If not, I will
be surprised.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top