I'm lost

sjn78

Well-known member
Joined
May 4, 2003
Messages
255
Location
Australia
Trying to draw a simple line on a form and cannot figure out where I am going wrong. I have done this when I send a doc to print, but the same method isnt working.

I have a form with tabpages on it. On one of the tabpages I have a Picture Box where I want the line to be.


Dim PSNormal As New Pen(Black, 1)
Dim g As Graphics = Me.pb.CreateGraphics

g.DrawLine(PSNormal, 5, 50, TabPage5.Width - 5, 50)


Also, this is in a function in. Could that be the reason it is not working??

I can create a label on the fly and have it appear, just not the line.


Thanks
 
The tabs have the paint event fired everytime you switch back to them. So what probably happens is that when you switch to it everything gets earased because of the paint event.
If what Im talking about is not the case please correct me :).
 
I think that is what was happening. I put a picture box on the tab, then on the picture box paint event i drew the lines. This works.

Thanks
 
Back
Top