Click to See Complete Forum and Search --> : Rich Text Box Challenge !!!


tanhweeching
November 24th, 1999, 12:52 AM
Thanks for looking into these problems, I have a doubt of "How to Display a table (like Microsoft Excel table) by using the RichText Box ?" Futhermore, it can do Margin Settings, resize as A4 size, some others functions, which is similar in Microsoft Word. Could you kindly provide some short coding or example for me to refer. One more question, do you know what is both the largest width and height of Rich Text Box (in centimeter)?

Ravi Kiran
November 24th, 1999, 02:24 AM
I think using rich text box it is not very easy to draw lines and tables.
Otherwise why would MS come out with Word!:-)

You should try it as a picture object and it gets quite messed.
Take a look at WordPad written using MFC's CRichEdit control, which i think leverages the max possible with RTB, and it doesn't provide you with a faclity to draw tables. So i guess it is not possible directly.

For margins you could try EM_SETMARGINS message, which takes left & right widths in pixels. IIRC.

RK

Chris Eastwood
November 24th, 1999, 02:30 AM
In addition to Ravi's post - you should checkout the new RichText control available at http://vbaccelerator.com (- it comes with free source code).

This control will allow you to use more functionality of the underlying RichEdit 2.00 and 3.00 (3.00 if you have Win2000) - so you can have background bitmaps, transparency etc - I believe that the 2.00 RichEdit control implements more functionality of RTF so you may be in luck with tables (haven't tried it though).


Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

Ravi Kiran
November 24th, 1999, 03:11 AM
I tried a small test : Made a table in Word and saved it as RTF. RTF itself supports tables i think.

When i opend this file using Wordpad, what it did was funny initially: It created a ole object and put the file as Word document, and when i doule click on it i see the word menus and all. : Then later it made sense because the file and its document type are registered as Word's, so it will invoke word.


RK