📄 form1.frm
字号:
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
For i = 1 To 19
PctQiPan.Line (1, i)-(19, i)
PctQiPan.Line (i, 1)-(i, 19)
Next i
PctQiPan.Circle (4, 4), 0.1
PctQiPan.Circle (4, 10), 0.1
PctQiPan.Circle (4, 16), 0.1
PctQiPan.Circle (10, 4), 0.1
PctQiPan.Circle (16, 4), 0.1
PctQiPan.Circle (10, 10), 0.1
PctQiPan.Circle (10, 16), 0.1
PctQiPan.Circle (16, 10), 0.1
PctQiPan.Circle (16, 16), 0.1
End With
End Sub
Private Sub HuiFu()
With PctQiPan
If .Point(4 + 0.08, 4 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (4, 4), 0.1
End If
If .Point(4 + 0.08, 10 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (4, 10), 0.1
End If
If .Point(4 + 0.08, 16 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (4, 16), 0.1
End If
If .Point(10 + 0.08, 4 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (10, 4), 0.1
End If
If .Point(16 + 0.08, 4 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (16, 4), 0.1
End If
If .Point(10 + 0.08, 10 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (10, 10), 0.1
End If
If .Point(10 + 0.08, 16 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (10, 16), 0.1
End If
If .Point(16 + 0.08, 10 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (16, 10), 0.1
End If
If .Point(16 + 0.08, 16 + 0.08) = .BackColor Then
.DrawWidth = 2
.DrawStyle = 0
.DrawMode = 13
.ForeColor = RGB(0, 0, 0)
.FillStyle = 0
.FillColor = RGB(0, 0, 0)
PctQiPan.Circle (16, 16), 0.1
End If
End With
End Sub
Private Sub XiaZi(PosX, PosY)
Static Zcolor
With PctQiPan
Zcolor = .Point(PosX + 0.2, PosY + 0.2)
If Zcolor <> .BackColor Then Exit Sub
If PosX = 0 Or PosY = 0 Or PosX = 20 Or PosY = 20 Then Exit Sub
H_B = Not H_B
If H_B Then
.FillColor = RGB(0, 0, 0)
.ForeColor = RGB(0, 0, 0)
Else
.FillColor = RGB(255, 255, 255)
.ForeColor = RGB(255, 255, 255)
End If
PctQiPan.Circle (PosX, PosY), 0.3
End With
End Sub
Private Sub TiZi1(PosX, PosY, Zcolor)
Static XPos%(1 To 381), YPos%(1 To 381), PosI%, i%, j%, k%, XT As Boolean, OldPosI%
PosI = 1
XPos(1) = PosX
YPos(1) = PosY
PctQiPan.ForeColor = PctQiPan.BackColor
Do While True
DoEvents
OldPosI = PosI
For i = 1 To 19
For j = 1 To 19
XT = False
For k = 1 To PosI
If i = XPos(k) And j = YPos(k) Then XT = True: Exit For
Next k
For k = 1 To PosI
If XT Then Exit For
If i + 1 <> 20 And PctQiPan.Point(i + 0.2, j + 0.2) = Zcolor And i + 1 = XPos(k) And j = YPos(k) Then
PosI = PosI + 1
XPos(PosI) = i
YPos(PosI) = j
XT = True
End If
If XT Then Exit For
If i - 1 <> 0 And PctQiPan.Point(i + 0.2, j + 0.2) = Zcolor And i - 1 = XPos(k) And j = YPos(k) Then
PosI = PosI + 1
XPos(PosI) = i
YPos(PosI) = j
XT = True
End If
If XT Then Exit For
If j + 1 <> 20 And PctQiPan.Point(i + 0.2, j + 0.2) = Zcolor And i = XPos(k) And j + 1 = YPos(k) Then
PosI = PosI + 1
XPos(PosI) = i
YPos(PosI) = j
XT = True
End If
If XT Then Exit For
If j - 1 <> 0 And PctQiPan.Point(i + 0.2, j + 0.2) = Zcolor And i = XPos(k) And j - 1 = YPos(k) Then
PosI = PosI + 1
XPos(PosI) = i
YPos(PosI) = j
XT = True
End If
Next k
Next j
Next i
If OldPosI = PosI Then Exit Do
Loop
XT = False
For k = 1 To PosI
If PctQiPan.Point(XPos(k) + 1 + 0.2, YPos(k) + 0.2) = PctQiPan.BackColor And XPos(k) + 1 <> 20 Then XT = True: Exit For
If PctQiPan.Point(XPos(k) - 1 + 0.2, YPos(k) + 0.2) = PctQiPan.BackColor And XPos(k) - 1 <> 0 Then XT = True: Exit For
If PctQiPan.Point(XPos(k) + 0.2, YPos(k) + 1 + 0.2) = PctQiPan.BackColor And YPos(k) + 1 <> 20 Then XT = True: Exit For
If PctQiPan.Point(XPos(k) + 0.2, YPos(k) - 1 + 0.2) = PctQiPan.BackColor And YPos(k) - 1 <> 0 Then XT = True: Exit For
Next k
If XT Then Exit Sub
PctQiPan.FillColor = PctQiPan.BackColor
For k = 1 To PosI
PctQiPan.ForeColor = PctQiPan.BackColor
PctQiPan.Circle (XPos(k), YPos(k)), 0.3
PctQiPan.ForeColor = RGB(0, 0, 0)
If XPos(k) = 1 Then
PctQiPan.Line (XPos(k), YPos(k))-(XPos(k) + 0.5, YPos(k))
ElseIf XPos(k) = 19 Then
PctQiPan.Line (XPos(k) - 0.5, YPos(k))-(XPos(k), YPos(k))
Else
PctQiPan.Line (XPos(k) - 0.5, YPos(k))-(XPos(k) + 0.5, YPos(k))
End If
If YPos(k) = 1 Then
PctQiPan.Line (XPos(k), YPos(k))-(XPos(k), YPos(k) + 0.5)
ElseIf YPos(k) = 19 Then
PctQiPan.Line (XPos(k), YPos(k) - 0.5)-(XPos(k), YPos(k))
Else
PctQiPan.Line (XPos(k), YPos(k) - 0.5)-(XPos(k), YPos(k) + 0.5)
End If
Next k
End Sub
Private Sub TiZi(PosX, PosY)
Static Zcolor
With PctQiPan
If H_B Then
Zcolor = RGB(255, 255, 255)
Else
Zcolor = RGB(0, 0, 0)
End If
If .Point(PosX - 1, PosY) = Zcolor Then TiZi1 PosX - 1, PosY, Zcolor
If .Point(PosX + 1, PosY) = Zcolor Then TiZi1 PosX + 1, PosY, Zcolor
If .Point(PosX, PosY - 1) = Zcolor Then TiZi1 PosX, PosY - 1, Zcolor
If .Point(PosX, PosY + 1) = Zcolor Then TiZi1 PosX, PosY + 1, Zcolor
End With
End Sub
Private Sub End_Click()
End
End Sub
Private Sub Form_Load()
PctQiPan.ScaleWidth = 20
PctQiPan.ScaleHeight = 20
Me.Show
QiPan
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
XiaZi X \ 1, Y \ 1
TiZi X \ 1, Y \ 1
DoEvents
Call HuiFu
Call DaJie(X \ 1, Y \ 1)
End Sub
Private Sub start_Click()
QiPan
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -