Jump to content
Xtreme .Net Talk

Recommended Posts

Guest Chiragc
Posted

Hi everyone!

Can anyone tell me how to draw a triangle in vb.net?

I am using the drawPolygon method.

I want to use variables such as Xpos, and Ypos, instead of static variables.

 

any ideas?

  • *Gurus*
Posted
   Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
       Dim Points(2) As Point

       Points(0) = New Point(100, 100)
       Points(1) = New Point(150, 100)
       Points(2) = New Point(100, 150)
       e.Graphics.DrawPolygon(Pens.Red, Points)
   End Sub

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

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