locked
how to add tag that wrap string to richtextbox in window form RRS feed

  • Question

  • Hi,

    I want to add a tag that wrap a string to richtextbox (as "marker 59" in picture). It should be within text. I guess it be a thumbnail. How to do it? Thanks.

    Monday, March 19, 2012 8:24 PM

Answers

  • Sure, if your background if white, put this code to make the borde of a cell white as well:

    "{\colortbl ;\red255\green255\blue255;}"


    Mitja

    • Marked as answer by york Z Tuesday, March 20, 2012 7:34 AM
    Tuesday, March 20, 2012 6:09 AM
  • Maybe can be a table with one cell only. Check it here.

    Mitja

    • Marked as answer by york Z Tuesday, March 20, 2012 7:34 AM
    Tuesday, March 20, 2012 12:50 AM

All replies

  • Maybe can be a table with one cell only. Check it here.

    Mitja

    • Marked as answer by york Z Tuesday, March 20, 2012 7:34 AM
    Tuesday, March 20, 2012 12:50 AM
  • Thanks, Mitja. One more question, I can create a table with 2 cells in RichTextBox, 1 is visible and 1 is not, right?


    York

    Tuesday, March 20, 2012 4:07 AM
  • Sure, if your background if white, put this code to make the borde of a cell white as well:

    "{\colortbl ;\red255\green255\blue255;}"


    Mitja

    • Marked as answer by york Z Tuesday, March 20, 2012 7:34 AM
    Tuesday, March 20, 2012 6:09 AM
  • For more very useful info about tables and other stuff in richTextBox can be found here.

    And this one too.


    Mitja


    • Edited by Mitja Bonca Tuesday, March 20, 2012 6:21 AM
    Tuesday, March 20, 2012 6:16 AM
  • Example with black border:

     string str = "{\\rtf1\\fbidis\\ansi\\ansicpg1252\\deff0\\deflang1033\\deflangfe2052{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 Calibri;}{\\f1\\froman\\fprq2\\fcharset0 Times New Roman;}}\r\n{\\colortbl ;\\red0\\green0\\blue0;}\r\n\\viewkind4\\uc1\\trowd\\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10\\brdrcf1 \\trbrdrl\\brdrs\\brdrw10\\brdrcf1 \\trbrdrb\\brdrs\\brdrw10\\brdrcf1 \\trbrdrr\\brdrs\\brdrw10\\brdrcf1 \\clbrdrt\\brdrw15\\brdrs\\clbrdrl\\brdrw15\\brdrs\\clbrdrb\\brdrw15\\brdrs\\clbrdrr\\brdrw15\\brdrs \\cellx990\\pard\\intbl\\ltrpar\\sl276\\slmult1\\f0\\fs22 A cell\\f1\\cell\\row\r\n\\pard\\ltrpar\\sa200\\sl276\\slmult1\\par\r\n}\r\n";
     richTextBox1.Rtf = str;

    and example with white border (no border):

     string str = "{\\rtf1\\fbidis\\ansi\\ansicpg1252\\deff0\\deflang1033\\deflangfe2052{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 Calibri;}{\\f1\\froman\\fprq2\\fcharset0 Times New Roman;}}\r\n{\\colortbl ;\\red255\\green255\\blue255;}\r\n\\viewkind4\\uc1\\trowd\\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10\\brdrcf1 \\trbrdrl\\brdrs\\brdrw10\\brdrcf1 \\trbrdrb\\brdrs\\brdrw10\\brdrcf1 \\trbrdrr\\brdrs\\brdrw10\\brdrcf1 \\clbrdrt\\brdrw15\\brdrs\\clbrdrl\\brdrw15\\brdrs\\clbrdrb\\brdrw15\\brdrs\\clbrdrr\\brdrw15\\brdrs \\cellx990\\pard\\intbl\\ltrpar\\sl276\\slmult1\\f0\\fs22 A cell\\f1\\cell\\row\r\n\\pard\\ltrpar\\sa200\\sl276\\slmult1\\par\r\n}\r\n";
     richTextBox1.Rtf = str;


    Mitja

    Tuesday, March 20, 2012 6:18 AM