Rich Text box and Table(Visual C# 2005) RRS feed

  • Question

  • Hey,

    is it possible to make the Rich Textbox Control have a table inserted into it?

    Like the way MS Word does?

    Thanks :)

    Sunday, August 27, 2006 5:11 PM

All replies

  • You can copy the table in the word document, and paste it in the rich textbox. And it works well.
    Monday, August 28, 2006 1:57 AM
  • But there is no way to code it into it? As a feature in the program? unless you customly made your own richtextbox control?



    Thanks :)

    Monday, August 28, 2006 5:34 PM
  • Well then, I'd like to know how you express the table. If it's done, the problem is easy to solve.

    Actually, with the copy & paste in the run time, the technique - OLE - is employed. Here's a link. http://en.wikipedia.org/wiki/ActiveX I'm thinking whether you can use this to accomplish your task. Just an idea. Hope this helps.

    Tuesday, August 29, 2006 1:25 AM
  • I read it, I dont really know still...like what I was thinking was that I could make a form that works witht eh main form(I can do that) and in the form it has options to type int he number of columns and rows you want, and then when you press ok then the form sends the info to the main form and to the rich textbox and creates a table, I can do all of the sending info stuff with global variables, but I look thrue all of the intelliscence and I came across nothing I thought would have the stuff to add a table tot he rich textbox just as if you were making it do bullets.


    Thanks :)

    Tuesday, August 29, 2006 1:41 AM
  • Hi,

    The richtextbox use the Rich Text Format, it's another kind of markup language which control the format of the text. In some extent similar to the html markup language. Maybe you can have a look at this. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec_4.asp 

    Hope this helps.

    Tuesday, August 29, 2006 2:13 AM
  • To have a taste of the rtf syntax. The code below works:

    this.richTextBox1.Rtf = @"{\rtf1\ansi This is in \b bold\b0.}";
    . But it seems hard to manipulate the table syntax. ...

    Another idea: you can use the webbrowser control showing the table generated. Because the html markup language is much more easy to handle.

    Hope this helps.

    Tuesday, August 29, 2006 2:26 AM
  • I dont really see what the code is suppoesed to do that you gave me...

    but how would a web browser control be used as a textbox...?...


    Thanks :)

    Friday, September 1, 2006 2:49 AM
  • I'd like to say that it's hard to manipulate directly the table in richtextbox. Regarding the web browser control I mentioned, I thought you can use it to display the table generated. Of course, it can't get inputs. :-)
    Friday, September 1, 2006 3:17 AM
  • hmm, I will have to think it up somehow then...
    Friday, September 1, 2006 3:29 AM
  • Hi,

    I'm in a trouble with my C# application using rich text box. It shows excel table but destroys when the table is processed more.

    for example I send the table with mail body. but table is destroyed.

    please, help.


    Tuesday, May 24, 2011 6:40 AM