当我运行代码时,我在 pen1 上遇到错误,说对象引用未设置为对象的实例
Dim pen1 As Pen
.
.
.
.
Private Sub setDash()
Select Case selectDash
Case 1
pen1.DashStyle = Drawing2D.DashStyle.Dash
Case 2
pen1.DashStyle = Drawing2D.DashStyle.Dot
Case 3
pen1.DashStyle = Drawing2D.DashStyle.DashDot
Case 4
pen1.DashStyle = Drawing2D.DashStyle.DashDotDot
Case 5
pen1.DashStyle = Drawing2D.DashStyle.Solid
End Select
End Sub