?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "A*智能路徑演算 ——天恩軟件 BYZH1110"
ClientHeight = 7125
ClientLeft = 45
ClientTop = 330
ClientWidth = 10995
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 475
ScaleMode = 3 'Pixel
ScaleWidth = 733
StartUpPosition = 2 '屏幕中心
Begin VB.ListBox List1
Height = 6180
Left = 9480
TabIndex = 4
Top = 120
Width = 1455
End
Begin VB.Timer Timer1
Interval = 60
Left = 7440
Top = 6480
End
Begin VB.OptionButton Option3
Caption = "終點"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 3480
Style = 1 'Graphical
TabIndex = 3
Top = 6600
Width = 855
End
Begin VB.OptionButton Option2
Caption = "起點"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 2040
Style = 1 'Graphical
TabIndex = 2
Top = 6600
Width = 855
End
Begin VB.OptionButton Option1
Caption = "墻"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 600
Style = 1 'Graphical
TabIndex = 1
Top = 6600
Value = -1 'True
Width = 855
End
Begin VB.PictureBox Picture1
BackColor = &H00008000&
FillColor = &H00FFFFFF&
ForeColor = &H00FFFFFF&
Height = 6375
Left = 0
ScaleHeight = 421
ScaleMode = 3 'Pixel
ScaleWidth = 621
TabIndex = 0
Top = 0
Width = 9375
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mastae(32, 22) As Byte
Dim stae As Integer
Dim st As Boolean
Public Sub pas()
For i = 0 To 30
For j = 0 To 20
'If mastae(i, j) = 1 Then
If 1 Then
If ma(i, j) = 1 Then
Picture1.Line (i * 20, j * 20)-(i * 20 + 19, j * 20 + 19), QBColor(0), BF
Else
Picture1.Line (i * 20, j * 20)-(i * 20 + 19, j * 20 + 19), QBColor(2), BF
End If
End If
Next
Next
Picture1.Line (star.x * 20, star.y * 20)-(star.x * 20 + 19, star.y * 20 + 19), QBColor(4), BF
Picture1.Line (endd.x * 20, endd.y * 20)-(endd.x * 20 + 19, endd.y * 20 + 19), QBColor(9), BF
End Sub
Private Sub Form_Load()
star.x = 28: star.y = 4 '開始的起點與終點
endd.x = 7: endd.y = 18
End Sub
Private Sub Option1_Click()
stae = 0
End Sub
Private Sub Option2_Click()
stae = 1
End Sub
Private Sub Option3_Click()
stae = 2
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
ad x, y
st = True
Form1.List1.Clear
aithinkk
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If st Then ad x, y
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
For i = 0 To 30
For j = 0 To 20
mastae(i, j) = 0
Next
Next
st = False
End Sub
Private Sub Picture1_Paint()
pas
End Sub
Public Sub ad(x As Single, y As Single)
i = (x - 10) / 20: j = (y - 10) / 20
If i >= 0 And j >= 0 And i <= 30 And j <= 20 Then
If stae = 0 Then
If mastae(i, j) = 0 Then
mastae(i, j) = 1
If ma(i, j) = 0 Then
ma(i, j) = 1
Else
ma(i, j) = 0
End If
End If
ElseIf stae = 1 Then
mastae(star.x, star.y) = 1
star.x = i: star.y = j
ElseIf stae = 2 Then
mastae(endd.x, endd.y) = 1
endd.x = i: endd.y = j
End If
End If
pas
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -