Hi,
I wanted to know how do I create the exact polygon in my main form.
I've now created a class "PolygonShape" and inside there is this code(this is a shape of a trapezium):
Then in my main, I've initialize as below
P/S : i know why it turn out to be rectangle... but i don't know how to make it to follow the design at top when displaying it..
PROBLEM : when i run this code, then it will come out with a rectangle shape.I've alread tried to research.. but i dont get any ways to make the shape become the shape of the trapezium. Any idea?
I wanted to know how do I create the exact polygon in my main form.
I've now created a class "PolygonShape" and inside there is this code(this is a shape of a trapezium):
VB.NET:
Protected Overloads Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create points that define polygon.
Dim point1 As New Point(0, 0)
Dim point2 As New Point(0, 50)
Dim point3 As New Point(150, 50)
Dim point7 As New Point(70, 0)
Dim curvePoints As Point() = {point1, point2, point3, point7}
' Draw polygon to screen.
pe.Graphics.DrawPolygon(blackPen, curvePoints)
End Sub
Then in my main, I've initialize as below
VB.NET:
Dim poliA As New PolygonShape()
poliA.Width = 100
poliA.Height = 50
poliA.BackColor = Color.Azure
P/S : i know why it turn out to be rectangle... but i don't know how to make it to follow the design at top when displaying it..
PROBLEM : when i run this code, then it will come out with a rectangle shape.I've alread tried to research.. but i dont get any ways to make the shape become the shape of the trapezium. Any idea?
Last edited by a moderator: