?? form1.frm
字號:
End
Begin VB.Menu game
Caption = "游戲(&G)"
Begin VB.Menu Menu_New
Caption = "開局(&N)"
Shortcut = {F2}
End
Begin VB.Menu Menu_0
Caption = "-"
End
Begin VB.Menu Menu_B
Caption = "初級(&B)"
End
Begin VB.Menu Menu_I
Caption = "中級(&I)"
End
Begin VB.Menu Menu_E
Caption = "高級(&E)"
Checked = -1 'True
End
Begin VB.Menu Menu_C
Caption = "自定義(C)..."
End
Begin VB.Menu Menu_1
Caption = "-"
End
Begin VB.Menu Menu_M
Caption = "標記(?)(&M)"
Checked = -1 'True
End
Begin VB.Menu Menu_L
Caption = "顏色(&L)"
Checked = -1 'True
End
Begin VB.Menu Menu_S
Caption = "聲音(&S)"
End
Begin VB.Menu Menu_2
Caption = "-"
End
Begin VB.Menu Menu_T
Caption = "掃雷英雄榜(&T)..."
End
Begin VB.Menu Menu_4
Caption = "-"
End
Begin VB.Menu Menu_X
Caption = "退出(&X)"
End
End
Begin VB.Menu help
Caption = "幫助(&H)"
Begin VB.Menu Menu_C1
Caption = "目錄(&C)"
Shortcut = {F1}
End
Begin VB.Menu Menu_S1
Caption = "查找幫助主題(&S)..."
End
Begin VB.Menu Menu_H1
Caption = "使用幫助(&H)"
End
Begin VB.Menu Menu_01
Caption = "-"
End
Begin VB.Menu Menu_A1
Caption = "關于掃雷(&A)"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*************************************************************************
'** 葉帆源碼 CSDN:yefanqiu
'**-----------------------------------------------------------------------
'**葉帆源碼:http://blog.csdn.net/yefanqiu -->[葉帆源碼]
'** XP窗體界面
'** 串口通信示例
'** 任意透明窗體
'** ...
'**葉帆軟件:http://blog.csdn.net/yefanqiu -->[葉帆軟件]
'** API 瀏覽器
'** VB源碼之友
'** 葉帆成語詞典
'** ...
'**最新動態:API瀏覽器 準備升級到 .net平臺
'** VB源碼之友 準備升級到 .net平臺
'**
'**更多軟件,更多源碼 請關注【葉帆Blog】
'**葉帆Blog:http://blog.csdn.net/yefanqiu
'*************************************************************************
'*************************************************************************
'**模 塊 名:Form1
'**說 明:葉帆軟件 版權所有2002 - 2004(C)
'**創 建 人:葉帆
'**日 期:2002年06月11日
'**修 改 人:
'**日 期:
'**描 述:掃雷原程序
'**版 本:V1.0
'*************************************************************************
Option Explicit
Private Sub Form_Load()
Dim i As Integer, j As Integer
For i = 1 To 24
For j = 1 To 30
If i = 24 And j = 30 Then GoTo exitfor
Load imgLei((i - 1) * 30 + j)
imgLei((i - 1) * 30 + j).Visible = True
Next j, i
exitfor:
'-------------------
If Dir(App.Path + "\yefan.ini") <> "" Then
Open App.Path + "\yefan.ini" For Input As #1
Input #1, jibie
Input #1, leiname(0)
Input #1, leiname(1)
Input #1, leiname(2)
Input #1, leitime(0)
Input #1, leitime(1)
Input #1, leitime(2)
Input #1, LeiRow
Input #1, LeiCol
Input #1, LeiNums
Close #1
Else
jibie = 1
leiname(0) = "佚名"
leiname(1) = "佚名"
leiname(2) = "佚名"
leitime(0) = "999"
leitime(1) = "999"
leitime(2) = "999"
End If
If jibie = 4 Then jibie = 1
Select Case jibie
Case 1
Menu_B_Click
Case 2
Menu_I_Click
Case 3
Menu_E_Click
Case 4
Menu_C_Click
End Select
End Sub
Private Sub ShowLei(i As Integer, j As Integer)
Select Case lei(j, i)
Case 0:
imgLei((i - 1) * LeiCol + j - 1).Picture = ImageList2.ListImages(9).Picture
Case 9:
imgLei((i - 1) * LeiCol + j - 1).Picture = ImageList1.ListImages(2).Picture
Case Else
imgLei((i - 1) * LeiCol + j - 1).Picture = ImageList2.ListImages(lei(j, i)).Picture
End Select
lei1((i - 1) * LeiCol + j - 1) = 1
End Sub
Private Sub ShowShui(col As Integer, row As Integer)
Dim i As Integer, j As Integer
Dim BeginX As Integer, BeginY As Integer
Dim x As Integer, y As Integer
' 清零
For i = 0 To 31
For j = 0 To 25
JieDian(i, j) = 0
Next j, i
'查起始點
j = row
While j > 0 And lei(col, j) <> 0
j = j - 1
Wend
If j <> row Then y = j + 1
x = col
y = j
Shui x, y
'---------------
For i = 1 To LeiRow
For j = 1 To LeiCol
If JieDian(j, i) = 1 Then
If i - 1 > 0 Then ShowLei i - 1, j
If i - 1 > 0 And j - 1 > 0 Then ShowLei i - 1, j - 1
If j - 1 > 0 Then ShowLei i, j - 1
If i + 1 < LeiRow + 1 And j - 1 > 0 Then ShowLei i + 1, j - 1
If i + 1 < LeiRow + 1 Then ShowLei i + 1, j
If i + 1 < LeiRow + 1 And j + 1 < LeiCol + 1 Then ShowLei i + 1, j + 1
If j + 1 < LeiCol + 1 Then ShowLei i, j + 1
If i - 1 > 0 And j + 1 < LeiCol + 1 Then ShowLei i - 1, j + 1
End If
Next j
Next i
'---------------
End Sub
Private Sub Shui(x As Integer, y As Integer)
'算法一
JieDian(x, y) = 1
If y - 1 > 0 And JieDian(x, y - 1) = 0 And lei(x, y - 1) = 0 Then Shui x, y - 1
If y - 1 > 0 And x - 1 > 0 And JieDian(x - 1, y - 1) = 0 And lei(x - 1, y - 1) = 0 Then Shui x - 1, y - 1
If x - 1 > 0 And JieDian(x - 1, y) = 0 And lei(x - 1, y) = 0 Then Shui x - 1, y
If y + 1 < LeiRow + 1 And x - 1 > 0 And JieDian(x - 1, y + 1) = 0 And lei(x - 1, y + 1) = 0 Then Shui x - 1, y + 1
If y + 1 < LeiRow + 1 And JieDian(x, y + 1) = 0 And lei(x, y + 1) = 0 Then Shui x, y + 1
If y + 1 < LeiRow + 1 And x + 1 < LeiCol + 1 And JieDian(x + 1, y + 1) = 0 And lei(x + 1, y + 1) = 0 Then Shui x + 1, y + 1
If x + 1 < LeiCol + 1 And JieDian(x + 1, y) = 0 And lei(x + 1, y) = 0 Then Shui x + 1, y
If y - 1 > 0 And x + 1 < LeiCol + 1 And JieDian(x + 1, y - 1) = 0 And lei(x + 1, y - 1) = 0 Then Shui x + 1, y - 1
End Sub
Private Sub Form_Resize()
If MeFlag = False And Me.WindowState = 0 Then
Me.Height = MeH
Me.Width = Me.Width
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Open App.Path + "\yefan.ini" For Output As #1
Print #1, jibie
Print #1, leiname(0)
Print #1, leiname(1)
Print #1, leiname(2)
Print #1, leitime(0)
Print #1, leitime(1)
Print #1, leitime(2)
Print #1, LeiRow
Print #1, LeiCol
Print #1, LeiNums
Close #1
End
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
imgNew.Picture = ImageList1.ListImages(6).Picture
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
imgNew.Picture = ImageList1.ListImages(5).Picture
End Sub
Private Sub Image2_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
imgNew.Picture = ImageList1.ListImages(6).Picture
End Sub
Private Sub Image2_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
imgNew.Picture = ImageList1.ListImages(5).Picture
End Sub
Private Sub img1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
imgNew.Picture = ImageList1.ListImages(6).Picture
End Sub
Private Sub img1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
imgNew.Picture = ImageList1.ListImages(5).Picture
End Sub
Private Sub imgLei_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
If LeiFlag = True Then Exit Sub
Static FlagNum As Integer
Static FlagTime(1) As Long
tongjiflag = False
'-----------------------------------------------
If Button = 1 And Shift = 0 Then
FlagNum = 1
FlagTime(0) = GetTickCount()
TongjiIndex = Index
Timer2.Enabled = True
Exit Sub
End If
If Button = 2 Then
If FlagNum = 1 Then
FlagNum = 2
FlagTime(1) = GetTickCount()
End If
End If
If FlagNum = 2 And FlagTime(1) - FlagTime(0) < 50 Then
FlagNum = 0
tongjiflag = True
'Text1 = "同擊"
TongClick Index, True
Exit Sub
End If
' '同擊
' If Button = 2 And lei1(Index) = 1 And lei((Index Mod LeiCol) + 1, Index \ LeiCol + 1) <> 0 Then
' TongClick Index
' End If
'
'-----------------------------------------------
'左擊
If Button = 1 Then
Dim i As Integer
Dim j As Integer
' Text1 = "左擊"
Select Case lei((Index Mod LeiCol) + 1, Index \ LeiCol + 1)
Case 0
ShowShui (Index Mod LeiCol) + 1, Index \ LeiCol + 1
Case 9
imgNew.Picture = ImageList1.ListImages(8).Picture
LeiFlag = True
For i = 1 To LeiRow
For j = 1 To LeiCol
If lei(j, i) = 9 And lei1((i - 1) * LeiCol + j - 1) <> 2 Then imgLei((i - 1) * LeiCol + j - 1).Picture = ImageList1.ListImages(2).Picture
If lei1((i - 1) * LeiCol + j - 1) = 2 And lei(j, i) <> 9 Then imgLei((i - 1) * LeiCol + j - 1).Picture = ImageList1.ListImages(9).Picture
Next j, i
imgLei(Index).Picture = ImageList1.ListImages(3).Picture
Case Else
ShowLei Index \ LeiCol + 1, (Index Mod LeiCol) + 1
End Select
End If
'右擊
'If Button = 2 Then Text1 = "右擊"
If Button = 2 And lei1(Index) <> 1 Then
Select Case lei1(Index)
Case 0:
lei1(Index) = 2
LeiNums1 = LeiNums1 - 1
ShowLeiNum Format(LeiNums1, "000")
imgLei(Index).Picture = ImageList1.ListImages(4).Picture
Case 2:
If Menu_M.Checked = True Then
lei1(Index) = 3
imgLei(Index).Picture = ImageList1.ListImages(10).Picture
Else
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -