Why can`t I get this to execute in the button1_click event?
VB.NET:
PublicSub AddCurveExample(ByVal e As PaintEventArgs)
' Create some points.
Dim point1 AsNew Point(20, 20)
Dim point2 AsNew Point(40, 0)
Dim point3 AsNew Point(60, 40)
Dim point4 AsNew Point(80, 20)
' Create an array of the points.
Dim curvePoints As Point() = {point1, point2, point3, point4}
' Create a GraphicsPath object and add a curve.
Dim myPath AsNew GraphicsPath
myPath.AddCurve(curvePoints, 0, 3, 0.8F)
' Draw the path to the screen.
Dim myPen AsNew Pen(Color.Black, 2)
e.Graphics.DrawPath(myPen, myPath)
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AddCurveExample()
EndSub
Last edited by a moderator: