لدي هذا الكود حيث يقوم بطباعة مستطيل منحني الأطراف أريد عمله في شكل إجراء
Dim f As New Font("Times New Roman", 12, FontStyle.Underline)
Dim b As New SolidBrush(Color.Black)
Dim p As New Pen(Color.Black, 2)
Dim H As Integer = 100
Dim W As Integer = 100
Dim X12 As Single = 600
Dim Y13 As Single = 150
Dim Y24 As Single = 180
Dim X34 As Single = 50
' Create rectangle to bound ellipse.
Dim rect As New Rectangle(X12, Y13, H, W)
Dim rect2 As New Rectangle(X12, Y24, H, W)
Dim rect3 As New Rectangle(X34, Y13, H, W)
Dim rect4 As New Rectangle(X34, Y24, H, W)
' Create start and sweep angles on ellipse.
Dim startAngle As Single = 0.0F
Dim sweepAngle As Single = -90.0F
Dim startAngle2 As Single = 0.0F
Dim sweepAngle2 As Single = 90.0F
Dim startAngle3 As Single = 180.0F
Dim sweepAngle3 As Single = 90.0F
Dim startAngle4 As Single = 180.0F
Dim sweepAngle4 As Single = -90.0F
' Draw arc to screen.
e.Graphics.DrawArc(p, rect, startAngle, sweepAngle)
e.Graphics.DrawArc(p, rect2, startAngle2, sweepAngle2)
e.Graphics.DrawArc(p, rect3, startAngle3, sweepAngle3)
e.Graphics.DrawArc(p, rect4, startAngle4, sweepAngle4)
'##########################################
'LINE ONE & TWO
Dim XL1 As Single
Dim Y1L12 As Single
Dim Y2L12 As Single
Dim XL2 As Single
XL1 = X12 + W
XL2 = X34
Y1L12 = Y13 + (H / 2)
Y2L12 = Y24 + (H / 2)
e.Graphics.DrawLine(p, XL1, Y1L12, XL1, Y2L12)
e.Graphics.DrawLine(p, XL2, Y1L12, XL2, Y2L12)
'=======================
'LINE 3 & 4
Dim X1L34 As Single
Dim X2L34 As Single
Dim YL3 As Single
Dim YL4 As Single
X1L34 = X34 + (W / 2)
X2L34 = X12 + (W / 2)
YL3 = Y13
YL4 = Y24 + H
e.Graphics.DrawLine(p, X1L34, YL3, X2L34, YL3)
e.Graphics.DrawLine(p, X1L34, YL4, X2L34, YL4)أقوم بمناداته بهذه الكيفية :
drawroundedrectangle(x12, y13, x34, y24, h, w)
وبصراحة لم أفهم كيفية عمل الدوال يوما فهل أجد عندكم المساعدة؟