|
-
May 20th, 2007, 11:50 PM
#1
Thread Starter
Lively Member
[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.
Can be Fixed Width ie...5 or 6 inch or less.
Also Different Line Widths. ie..1 point, 2 point, etc..
Thanks,
Robert
-
May 21st, 2007, 12:07 AM
#2
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+.
-
May 21st, 2007, 12:10 AM
#3
Thread Starter
Lively Member
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
-
May 21st, 2007, 12:14 AM
#4
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.
-
May 21st, 2007, 12:17 AM
#5
Thread Starter
Lively Member
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
-
May 21st, 2007, 12:18 AM
#6
Re: [02/03] How do you Draw a Line in a Richtextbox
-
May 21st, 2007, 12:21 AM
#7
Thread Starter
Lively Member
Re: [02/03] How do you Draw a Line in a Richtextbox
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|