Click here to Skip to main content
15,882,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can we draw graphics (lines) inside textBox or RitchTextBox.

i.e. we have text inside a RitchTextBox and we want to draw a line between two of the words (selected in text box)
Updated 10-Feb-12 16:24pm

You cannot draw on RichTextBox, but you can add an image through a clipboard.

Please see my past answer:
how to open word file with images and bullets in a rich text box in desktop application.[^].

However, this is so awkward, intrusive (why modifying a Clipboard?) and weak, that I would not recommend to bother.

As to TextBox — just forget it. It would be much easier to make a totally custom control and add some text editing functionality to it. :-)

Share this answer
Espen Harlinn 11-Feb-12 5:09am    
No. It's not. And owner drawing a textbox is a living hell, so you can't even try that.
Share this answer
Sergey Alexandrovich Kryukov 10-Feb-12 21:57pm    
Totally agree about TextBox, but as to the RichTextBox, it's easy to insert an image, as I recently found out and tested -- please see my answer.

However, if you tell me that dealing with this in practice is just stupid, I'll readily agree.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900