完整代码:
Option Explicit
Dim MX As Long
Dim MY As Long
Dim NX As Long
Dim NY As Long
Dim Num1 As Double
Dim Num2 As Double
Dim Num3 As Double
Dim OIdx As Long
Private Sub Draw(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal Clr As Long)
On Error Resume Next
Select Case OIdx
Case 0
DrawDBX X1, Y1, X2, Y2, Clr, 3
Case 1
DrawW X1, Y1, X2, Y2, Clr
Case 2
DrawDBX X1, Y1, X2, Y2, Clr, 5
Case 3
Dim Bs As Long
Bs = Val(tBs.Text)
If Bs >= 3 Then DrawDBX X1, Y1, X2, Y2, Clr, Bs
Case 4
Dim Js As Long
Dim Jg As Long
Js = Val(tJs.Text)
Jg = Val(tJg.Text)
If Js Mod 2 <> 1 Then Js = Js + 1
tJs.Text = Js
If Jg < 1 Then Jg = 1
If Jg > Js - 4 Then Jg = Js - 4
If Jg Mod 2 <> 1 Then Jg = Jg - 1
If Js Mod Jg = 0 Then Jg = 1
tJg.Text = Jg
If Js >= 5 And Js Mod 2 = 1 Then DrawDJX X1, Y1, X2, Y2, Clr, Js, Jg
End Select
End Sub
Private Sub DrawW(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal Clr As Long)
Dim X3 As Long
Dim Y3 As Long
Dim X4 As Long
Dim Y4 As Long
Dim X5 As Long
Option Explicit
Dim MX As Long
Dim MY As Long
Dim NX As Long
Dim NY As Long
Dim Num1 As Double
Dim Num2 As Double
Dim Num3 As Double
Dim OIdx As Long
Private Sub Draw(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal Clr As Long)
On Error Resume Next
Select Case OIdx
Case 0
DrawDBX X1, Y1, X2, Y2, Clr, 3
Case 1
DrawW X1, Y1, X2, Y2, Clr
Case 2
DrawDBX X1, Y1, X2, Y2, Clr, 5
Case 3
Dim Bs As Long
Bs = Val(tBs.Text)
If Bs >= 3 Then DrawDBX X1, Y1, X2, Y2, Clr, Bs
Case 4
Dim Js As Long
Dim Jg As Long
Js = Val(tJs.Text)
Jg = Val(tJg.Text)
If Js Mod 2 <> 1 Then Js = Js + 1
tJs.Text = Js
If Jg < 1 Then Jg = 1
If Jg > Js - 4 Then Jg = Js - 4
If Jg Mod 2 <> 1 Then Jg = Jg - 1
If Js Mod Jg = 0 Then Jg = 1
tJg.Text = Jg
If Js >= 5 And Js Mod 2 = 1 Then DrawDJX X1, Y1, X2, Y2, Clr, Js, Jg
End Select
End Sub
Private Sub DrawW(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal Clr As Long)
Dim X3 As Long
Dim Y3 As Long
Dim X4 As Long
Dim Y4 As Long
Dim X5 As Long