none
RichTextBox control and "column" formatting

    Question

  • ive got a richtextbox control that ive got some text and a pic or 2 inserted into it. what im trying to accomplish (if possible) is to format the text and pictures into columns so that the text is on the left, and the pics are on the right and the pictures do not affect the line width of the text. what i mean here is if you rtb.Paste and image right after an append rather than on its own line, it will change the line height to match the pic. so id like to find a way to format the RTB into columns, left column for text, right column for pictures) so that when i save it to a file, i can also print it later if needed. any ideas on how i could maybe accomplish this?
    Thursday, April 23, 2009 10:24 PM

Answers

  • Yes, the grid has a cellBorder style that you can turn off. You can also turn off row and column headers.

    And just to ensure we are on the same page, you would *not* add the DataGridView to the rich text box. Rather, you would use the grid *instead* of the rich text box.

    Hope this helps.
    www.insteptech.com
    • Proposed as answer by Harry Zhu Monday, April 27, 2009 8:27 AM
    • Marked as answer by Harry Zhu Wednesday, April 29, 2009 5:47 AM
    Thursday, April 23, 2009 11:00 PM

All replies

  • Maybe you should use a DataGridView instead?
    www.insteptech.com
    Thursday, April 23, 2009 10:39 PM
  • im currently using the richtextbox to make "labels". a label defined here as a printable doc that has some lines of text and a picture and barcode accompanyment. at first, i had the lines of text appended, then the pic and the barcode (which is also just a pic) afterwards and id save it as *.rtf, but its looking like i need to re-arrange it so that its on a half sheet of paper.
    my first thought if i used a grid would be would it have grid lines? prolly sounds silly but its the first thing i think of when adding a table or grid to a RTB.
    Thursday, April 23, 2009 10:47 PM
  • Yes, the grid has a cellBorder style that you can turn off. You can also turn off row and column headers.

    And just to ensure we are on the same page, you would *not* add the DataGridView to the rich text box. Rather, you would use the grid *instead* of the rich text box.

    Hope this helps.
    www.insteptech.com
    • Proposed as answer by Harry Zhu Monday, April 27, 2009 8:27 AM
    • Marked as answer by Harry Zhu Wednesday, April 29, 2009 5:47 AM
    Thursday, April 23, 2009 11:00 PM