📄 form1.txt
字号:
Top = 3240
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 11
Left = 4320
Stretch = -1 'True
Top = 2400
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 10
Left = 3480
Stretch = -1 'True
Top = 2400
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 9
Left = 2640
Stretch = -1 'True
Top = 2400
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 8
Left = 1800
Stretch = -1 'True
Top = 2400
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 7
Left = 4320
Stretch = -1 'True
Top = 1560
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 6
Left = 3480
Stretch = -1 'True
Top = 1560
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 5
Left = 2640
Stretch = -1 'True
Top = 1560
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 4
Left = 1800
Stretch = -1 'True
Top = 1560
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 3
Left = 4320
Stretch = -1 'True
Top = 720
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 2
Left = 3480
Stretch = -1 'True
Top = 720
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 1
Left = 2640
Stretch = -1 'True
Top = 720
Width = 855
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 855
Index = 0
Left = 1800
Stretch = -1 'True
Top = 720
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "智力拼图游戏"
BeginProperty Font
Name = "楷体_GB2312"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 735
Left = 2160
TabIndex = 0
Top = 0
Width = 3615
End
Begin VB.Menu wenjian
Caption = "文件"
Begin VB.Menu kaishiyouxi
Caption = "开始游戏"
End
Begin VB.Menu canzhaotupian
Caption = "参照图片"
Begin VB.Menu cankao
Caption = "参考图片"
End
Begin VB.Menu quxiao
Caption = "取消参考"
End
End
Begin VB.Menu tuichu
Caption = "退出"
End
End
Begin VB.Menu bangzhu
Caption = "帮助"
Begin VB.Menu guanyuyouzi
Caption = "关于游戏"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim X1!, Y1!, a!, b!, c!, m%, tbh(15) As Integer, haha%
Private Sub banzhuzhuti_Click()
End Sub
Private Sub cankao_Click()
For ei = 0 To 15
Image3(ei).Visible = True
Next ei
End Sub
Private Sub Command1_Click()
bs = 0
For i = 0 To 3
For j = 0 To 3
aa = Int(PictureClip1.Width * (j) / 4)
bb = Int(PictureClip1.Height * (i) / 4)
cc = Int(PictureClip1.Width / 4)
dd = Int(PictureClip1.Height / 4)
PictureClip1.ClipX = aa
PictureClip1.ClipY = bb
PictureClip1.ClipWidth = cc
PictureClip1.ClipHeight = dd
Image3(bs).Picture = PictureClip1.Clip
bs = bs + 1
Next j
Next i
For r = 0 To 15
Image1(r).Picture = Image4.Picture
tbh(r) = -1
Next r
For i = 0 To 15
stupe:
Randomize
m = Fix(Rnd(1) * 16)
For j = 0 To 15
If m = tbh(j) Then
GoTo stupe
End If
Next j
tbh(i) = m
Label2(i).Caption = m
Next i
For i = 0 To 15
Image2(i).Picture = Image3(Val(Label2(i).Caption)).Picture
Next i
Timer1.Enabled = True
Label4.Visible = False
Label4.Caption = ""
For ei = 0 To 15
Image3(ei).Visible = False
Next ei
End Sub
Private Sub Command3_Click()
Command3.Enabled = False
Label5.Caption = "本局是第 关"
Label6.Caption = Val(Label6.Caption) + 1
If Label6.Caption = 2 Then
PictureClip1.Picture = LoadPicture("1.jpg")
End If
If Label6.Caption = 3 Then
PictureClip1.Picture = LoadPicture("2.jpg")
End If
If Label6.Caption = 4 Then
PictureClip1.Picture = LoadPicture("3.jpg")
End If
If Label6.Caption = 5 Then
PictureClip1.Picture = LoadPicture("4.jpg")
End If
If Label6.Caption = 6 Then
PictureClip1.Picture = LoadPicture("5.jpg")
End If
If Label6.Caption = 7 Then
PictureClip1.Picture = LoadPicture("6.jpg")
End If
If Label6.Caption = 8 Then
PictureClip1.Picture = LoadPicture("7.jpg")
End If
If Label6.Caption = 9 Then
PictureClip1.Picture = LoadPicture("8.jpg")
End If
If Label6.Caption = 10 Then
PictureClip1.Picture = LoadPicture("9.jpg")
End If
If Label6.Caption = 11 Then
PictureClip1.Picture = LoadPicture("10.jpg")
End If
If Label6.Caption = 12 Then
PictureClip1.Picture = LoadPicture("11.jpg")
End If
If Label6.Caption = 13 Then
PictureClip1.Picture = LoadPicture("12.jpg")
End If
If Label6.Caption = 14 Then
PictureClip1.Picture = LoadPicture("13.jpg")
End If
If Label6.Caption = 15 Then
PictureClip1.Picture = LoadPicture("14.jpg")
End If
If Label6.Caption = 16 Then
PictureClip1.Picture = LoadPicture("15.jpg")
End If
If Label6.Caption = 17 Then
PictureClip1.Picture = LoadPicture("16.jpg")
End If
If Label6.Caption = 18 Then
PictureClip1.Picture = LoadPicture("17.jpg")
End If
If Label6.Caption = 19 Then
PictureClip1.Picture = LoadPicture("18.jpg")
End If
If Label6.Caption = 20 Then
PictureClip1.Picture = LoadPicture("19.jpg")
End If
If Label6.Caption = 21 Then
PictureClip1.Picture = LoadPicture("20.jpg")
End If
If Label6.Caption = 22 Then
PictureClip1.Picture = LoadPicture("21.jpg")
End If
If Label6.Caption = 23 Then
PictureClip1.Picture = LoadPicture("22.jpg")
End If
If Label6.Caption = 24 Then
PictureClip1.Picture = LoadPicture("23.jpg")
End If
If Label6.Caption = 25 Then
PictureClip1.Picture = LoadPicture("24.jpg")
End If
If Label6.Caption = 26 Then
PictureClip1.Picture = LoadPicture("25.jpg")
End If
If Label6.Caption = 27 Then
PictureClip1.Picture = LoadPicture("26.jpg")
End If
If Label6.Caption = 28 Then
PictureClip1.Picture = LoadPicture("27.jpg")
End If
If Label6.Caption = 29 Then
PictureClip1.Picture = LoadPicture("29.jpg")
End If
If Label6.Caption = 30 Then
PictureClip1.Picture = LoadPicture("30.jpg")
End If
If Label6.Caption = 31 Then
PictureClip1.Picture = LoadPicture("31.jpg")
End If
If Label6.Caption = 32 Then
PictureClip1.Picture = LoadPicture("32.jpg")
End If
If Label6.Caption = 33 Then
PictureClip1.Picture = LoadPicture("33.jpg")
End If
If Label6.Caption = 34 Then
PictureClip1.Picture = LoadPicture("34.jpg")
End If
If Label6.Caption = 35 Then
PictureClip1.Picture = LoadPicture("35.jpg")
End If
If Label6.Caption = 36 Then
PictureClip1.Picture = LoadPicture("36.jpg")
End If
If Label6.Caption = 37 Then
PictureClip1.Picture = LoadPicture("37.jpg")
End If
If Label6.Caption = 38 Then
PictureClip1.Picture = LoadPicture("38.jpg")
End If
If Label6.Caption = 39 Then
PictureClip1.Picture = LoadPicture("39.jpg")
End If
If Label6.Caption = 40 Then
Label5.Caption = "最后一关"
Label6.Visible = False
PictureClip1.Picture = LoadPicture("40.jpg")
End If
If Label6.Caption = 41 Then
Label4.Visible = True
Label4.Caption = "佩服!佩服! 打通关了! "
Timer2.Enabled = True
Else
Call Command1_Click
End If
End Sub
Private Sub Form_Load()
Label4.Visible = False
Call Command1_Click
Command3.Enabled = False
Label5.Caption = "本局是第 关"
Label6.Caption = 1
Label8.Caption = 0
Timer2.Enabled = False
End Sub
Private Sub guanyuyouzi_Click()
Label4.Visible = True
Label4.FontSize = 22
Label4.Caption = "本软件是初学者靳涛制作,如有技术问题请与我联系. 电话:13540619689"
End Sub
Private Sub Image1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
If Image1(Index).Picture = Image4.Picture Then
Image1(Index).Picture = Image2(c).Picture
Image2(c).Picture = Image4.Picture
Else
For fanx = 0 To 15
DoEvents
If Image2(fanx).Picture = Image4.Picture Then
Image2(fanx).Picture = Image1(Index).Picture
Image1(Index).Picture = Image2(c).Picture
Image2(c).Picture = Image4.Picture
Exit For
End If
Next fanx
End If
End Sub
Private Sub Image2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
X1 = X
Y1 = Y
a = Image2(Index).Left
b = Image2(Index).Top
c = Index
Image2(Index).Drag 1
End Sub
Private Sub kaishiyouxi_Click()
Label4.FontSize = 72
Call Command1_Click
End Sub
Private Sub quxiao_Click()
For ei = 0 To 15
Image3(ei).Visible = False
Next ei
End Sub
Private Sub Timer1_Timer()
For reww = 0 To 15
DoEvents
If Image1(reww).Picture <> Image3(reww).Picture Then
Exit For
End If
Next reww
If reww = 16 Then
Timer1.Enabled = False
Label4.Visible = True
Label4.Caption = " 恭喜你! 过关了!"
Label8.Caption = Val(Label8.Caption) + 100
Command3.Enabled = True
Else
For ytu = 0 To 15
DoEvents
If Image1(ytu).Picture = Image4.Picture Then
Exit For
End If
Next ytu
If ytu = 16 Then
Timer1.Enabled = False
Label4.Visible = True
Label4.Caption = "失败了!"
End If
End If
End Sub
Private Sub Timer2_Timer()
haha = haha + 1
If haha = 2 Then
Label4.Caption = "拜拜!"
End If
If haha = 3 Then
End
End If
End Sub
Private Sub tuichu_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -