Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to create tables in rich text box??

DamselDamsel Posts: 88Member
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

Comments

  • DamselDamsel Posts: 88Member
    : 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.
  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : 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.
  • DamselDamsel Posts: 88Member
    : : 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?

    Thank you for replying appreciate it.
    Damsel
  • kel1981bkel1981b Posts: 852Member
    : : 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?
  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : 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.
Sign In or Register to comment.