problem with RichTextBox control

I

Iain Mcleod

Hi folks.

Surely this must be a FAQ...?
I've trawled the web and only found one other person complaining about it,
but no solutions...
I wish to open an rtf file and edit it with a
System.Windows.Forms.RichTextBox.

So I downloaded a sample app from
http://www.codeproject.com/cs/menu/nicemenu.asp?df=100&forumid=13667&exp=0&select=386117#xx386117xx
Basically this just allows for file-open and save etc. onto a RichTextBox.

I opened an rtf with tables in it and found that it doesn't display or edit
correctly. Try creating one in MS Word and then saving as RTF.
Table cells with contents larger than the width of the cell do not allow the
table cell to span multiple rows. Instead, the text overlaps the next cell
(similar to an excel spreadsheet cell whose contents are larger than the
size of the cell and which doesn't have a neighbour to the right).
I also cannot edit the size of the table cells.

However, if I have an app that uses controls based on riched32.dll (wordpad
uses this), it seems to display fine.
Another app which works correctly is Jarte (www.jarte.com). These were
probably created in c++, MFC which I don't want to use as my company is 100%
..NET.

Why is the RichTextBox control so buggy? Or is it something which can be
corrected programmatically?
I can't find a way of manipulating tables within the RichTextBox class. Is
this possible?

Many thanks
Iain
 
R

Roy Soltoff

Don't know if this will help, but riched32 never supported tables. Wordpad
does not suport tables. It uses tab stops to make an appearance of a table.
 
M

mooni

Hi Iain,

The .NET framework references riched20.dll (Richedit Version 3.0; File
Version 5.30.23.1221) found in the system32 folder.

MS Word XP (2002) references riched20.dll (Richedit Version 4.0; File
Version 5.40.11.2212) found in the X:\program files\Common Files\Microsoft
Shared\Office10 folder.

I suspect (since I don't have Word 2003 currently installed) that Word 2003
references Version 5.0 of Richedit.

Tables in RTF work fine with version 4.0. To force your .NET application to
use this or a higher version of riched20.dll, copy and paste the file in
your executable's folder. Run the application and you should see proper
handling of tables.

The only problem here is whether or not MS allows distribution of Richedit
Version 4.0 or above with your applications(????).

Regards,

Bill
 
I

Iain Mcleod

Thanks Bill, that settles it: I'll give it a miss (the whole idea was to
lose dependency on office for licensing reasons - I don't want to have to
include one of its dlls) I think I'll use an open source asp.net based
editor and transformation function that I've come across.

Cheers
Iain
 

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