Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 isn't 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

  • *Experts*
Posted

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 :).

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...