|
-
Aug 6th, 2002, 07:05 PM
#1
Thread Starter
New Member
Drawing a line OVER other controls on a form.
I need to draw a line on a form, but it needs to be able to draw on top of other controls on the form.
Drawing a line on a form is no problem, eg.
Code:
Dim p As New Pen(Color.Red, 3)
Form1.CreateGraphics.Clear(Color.Gray)
Form1.CreateGraphics.DrawLine(p, 0, 0, 100, 100)
but this just draws the line on the form's background and any controls on the form get drawn on top of the line, thereby breaking the line.
What I need could be accomplished by creating a usercontrol 'Line', but this seems like a lot of overhead for a simple line. There has got to be a better way doesn't there?
Eamon
-
Aug 6th, 2002, 10:24 PM
#2
If you want to draw on the form then you wont be able to see it on the other controls. you could draw a portion of the line in every single control, but I dont think you want to do that
Making a user control as you said would be the best idea, IMHO. I dont think you would be able to "draw" it on other controls the way you want to
-
Aug 7th, 2002, 05:42 PM
#3
Fanatic Member
If VB.NET forms still have the clipcontrols property, play around with that... If worse comes to worse, you can subclass the form.
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
|