[02/03] How do you Draw a Line in a Richtextbox
Hello Everyone,
Can anyone Help me with this, How Do you Draw a Line in a Richtextbox. I don't even know where to Start Any Help would be great. :confused:
Can be Fixed Width ie...5 or 6 inch or less.
Also Different Line Widths. ie..1 point, 2 point, etc..
Thanks,
Robert
Re: [02/03] How do you Draw a Line in a Richtextbox
You draw a line on a RichTextBox the same way you do with any other control: using GDI+ in its Paint event handler. In the Paint event handler you would call the e.Graphics.DrawLine method. Presumably you want to draw this line in a location relative to some of the text. The RichTextBox class has numerous methods relating to text position, like GetPositionFromCharIndex. You can determine where to draw the line from such methods and then draw it with GDI+.
Re: [02/03] How do you Draw a Line in a Richtextbox
Could you help me out with some sample code. I'm New to VS2003.
Do I have to Use Imports System.Drawing or ?
Thanks,
Robert
Re: [02/03] How do you Draw a Line in a Richtextbox
Actually, disregard what I said. I now recall that classes derived from TextBoxBase don't support GDI+ drawing.
Re: [02/03] How do you Draw a Line in a Richtextbox
So Is it Possible ? or is there a way to Create a Graphics ie...jpg or.bmp line and insert it into the Richtextbox ?
Robert
Re: [02/03] How do you Draw a Line in a Richtextbox
Re: [02/03] How do you Draw a Line in a Richtextbox