How to create tables in rich text box??

I need to create a text aligner. I am having trouble creating a table (by table I mean physically the with rows and columns showing on screen). I work with rich text box control to keep my text format but can't find a way to create the tables.

Comments

: Hi : : I need to create a text aligner. I am having trouble creating a table (by table I mean physically the with rows and columns showing on screen). I work with rich text box control to keep my text format but can't find a way to create the tables. : : If anyone can help I would appreciate it. : Damsel : : I think I might have an idea,if anyone has some input please let me know.I think I should first write the text to a rtf file in word and create the table there then automatically open the file in my rtbox of my program.I think I should create a file with standard table in it then call that file place data in it and rename file then open it in rtbox.

Just don't know exactly how I am going to place data in the already existing table.

: I need to create a text aligner. I am having trouble creating a table (by table I mean physically the with rows and columns showing on screen). I work with rich text box control to keep my text format but can't find a way to create the tables. :

The RTB only supports RTF (and plain text by converting it to RTF) and, AFAIK, RTF doesn't support tables.

Depending on what you need, there might be another option: You could use multiple controls (one for each column). You could use a webbrowser control (if you only need display). You could use the DHTML/MSHTML control if you can use HTML and need editing. You could use OLE and embed a Word control in your app; this would essentially be Word, with all it's power.

: : I need to create a text aligner. I am having trouble creating a table (by table I mean physically the with rows and columns showing on screen). I work with rich text box control to keep my text format but can't find a way to create the tables. : : : : The RTB only supports RTF (and plain text by converting it to RTF) and, AFAIK, RTF doesn't support tables.: : Depending on what you need, there might be another option: You could use multiple controls (one for each column). You could use a webbrowser control (if you only need display). You could use the DHTML/MSHTML control if you can use HTML and need editing. You could use OLE and embed a Word control in your app; this would essentially be Word, with all it's power.: I have had very limited experience in HTML,am of course willing to learn more.I need the file to open in my program and not word.Meaning the user shouldn't know that word has been involved.Also if the user needs to insert/delete a certain row from the table they should be able to.With this being some of my most importent requirements which option would you choose?Where do I start to write this code?

: : I need to create a text aligner. I am having trouble creating a table (by table I mean physically the with rows and columns showing on screen). I work with rich text box control to keep my text format but can't find a way to create the tables. : : : : The RTB only supports RTF (and plain text by converting it to RTF) and, AFAIK, RTF doesn't support tables.: : Depending on what you need, there might be another option: You could use multiple controls (one for each column). You could use a webbrowser control (if you only need display). You could use the DHTML/MSHTML control if you can use HTML and need editing. You could use OLE and embed a Word control in your app; this would essentially be Word, with all it's power.: How about control array?

: I have had very limited experience in HTML,am of course willing to learn more.I need the file to open in my program and not word.Meaning the user shouldn't know that word has been involved.Also if the user needs to insert/delete a certain row from the table they should be able to.With this being some of my most importent requirements which option would you choose?Where do I start to write this code?:

If you use "Insertable Objects" (Ctrl+T, 3rd tab) to insert a Word object, the user won't necessarily know that Word has been involoved. The control should behave about like any other control on your form. However, I have little experience with insertable objects other than that they exist.

Using the DHTML/MSHTML control, you'll have what is basically an editable HTML document. You could include tables, text formatting, pictures, etc., pretty much anything supported by HTML. Although I played with it at one point, I don't see it in my list of controls so I can't tell you which control it is. I never got as far as adding/deleting rows in a table but every decent WYSIWYG editor allows you to so I assume it would also.

Personally, I'd probably try writing it using individual controls (as kel suggested) to simulate each cell unless they need to be able to select text across cells. In that case, I'd look into how to use MSHTML.