473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

RichTextFormat Guru needed

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\deflangf e1033{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}}
{\colortbl ;\red128\green0\blue0;}
{\*\generator Msftedit
5.41.15.1507;}\viewkind4\uc1\pard\nowidctlpar\qc\c f1\b\f0\fs36
Title\cf0\b0\fs24\par
\pard\nowidctlpar\sa120 Line #1\par
\par
Line #2\par
}
Jun 16 '06 #1
2 958
for loading the file have you set ?

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

"genojoe" <ge*****@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
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\deflangf e1033{\fonttbl{\f0\froman\
fprq2\fcharset0 Times New Roman;}} {\colortbl ;\red128\green0\blue0;}
{\*\generator Msftedit
5.41.15.1507;}\viewkind4\uc1\pard\nowidctlpar\qc\c f1\b\f0\fs36
Title\cf0\b0\fs24\par
\pard\nowidctlpar\sa120 Line #1\par
\par
Line #2\par
}

Jun 16 '06 #2

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.

Jun 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Mike Cox | last post by:
After writing an article trashing java, and C++, notable LISP guru Paul Graham is getting roasted on slashdot. Apart from AutoCAD and Emacs, what has LISP done anyway? Most real work is done in...
5
by: Raaijmakers, Vincent (IndSys,GE Interlogix) | last post by:
Looking at all the materials available, books, technologies etc etc.. I try to make a decision on what technology to select for a web server design, but I need help. I know, this question has...
36
by: Dmitriy Iassenev | last post by:
hi, I found an interesting thing in operator behaviour in C++ : int i=1; printf("%d",i++ + i++); I think the value of the expression "i++ + i++" _must_ be 3, but all the compilers I tested...
4
by: Accolo1 | last post by:
Help we are looking for this person, do you know them? William wjohnson@accolo.com Title: BEA WebLogic Portal Guru Job #: 03-04468 Check the pulse of your career! Evolve our eCommerce web...
9
by: Dan W. | last post by:
I'm trying to resolve a disagreement between friends --Digital Mars and BOOST-- about what the precompiler should do in a given situation: The problem arose when I was trying to compile a boost...
5
by: AWesner | last post by:
I have been working on a project to Search and Replace text within files. The project includes automatic file backups and date by date file restores. I use a richtextbox to display the text with...
3
by: Michael Suess | last post by:
Hi, please feel free to correct me if this is the wrong group to ask this question. I have a blog about parallel programming and concurrency (http://www.thinkingparallel.com if you are...
16
by: Singulus | last post by:
Hello all, I've searched for similar threads, I've found some bit of useful info here and there, but nevertheless I want to post my questions...So, how can I (we, in fact the forum can benefit...
1
by: stevenjs | last post by:
Greeings, all, Flash 8 has quiz templates which are coded for multiple choice, true/false, text statement, and matching types of questions, along with hotspots and probably anoher type I am...
4
by: Andrey | last post by:
Hi, I will be hiring a php guru to help us architect a highly scalable web site/web application; the problem is I am coming from Microsoft .NET world and not too much familiar with the platform....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.