0

I am creating a windows forms chart at runtime, which works fine. However, I have been asked to insert the chart into a rich text box at runtime.

I have looked at the API of the RichTextBox but cannot see any way to do this. Does anyone have any thoughts on whether this is possible? If so, how do you do it?

I have tried the following (VB.NET):

RichTextBox.Controls.Add(Chart)
RichTextBox.Refresh

But it doesn't appear.

David Brower
  • 2,888
  • 2
  • 25
  • 31
  • See [How can I insert an image into a RichTextBox?](http://stackoverflow.com/q/542850/719186) – LarsTech Jul 02 '14 at 15:03
  • So, copy an image of the chart to the clipboard and insert it as RTF into the RichTextBox? – David Brower Jul 02 '14 at 15:14
  • Yes (or convert the image to hex string and follow the link I gave you). That's probably the best you can do with the WinForms RichTextBox control. WPF's Rich Text controls offer better possibilities. – LarsTech Jul 02 '14 at 15:17
  • What I have done is mimic one large RichTextBox by using a Panel control with child RichTextBoxes and Chart controls and setting the background colour for all of them to white. So, it looks like text and graphs embedded in a RTF document. – David Brower Jul 02 '14 at 16:47

0 Answers0