高手请教:连连看游戏的vb编程思路怎样?
试试吧: Option Explicit '添加一个picture1(0),2个时钟控件 滚动条 ,窗体2 (form2为启动窗口) '请在D:新建文件夹 文件夹下加载10个图片(名字分别为 1、2、3、4、5。 。。。。10) '虽然做的不好 却是用心去做的 以修改了随即问题! Dim i As Integer '要建立的图片框个数 Dim aa As Integer Dim gg As Integer Dim ss As Integer Dim jj As Integer, hh As Integer '保存声明窗体的宽度和长度 Dim tt As Integer...全部
试试吧: Option Explicit '添加一个picture1(0),2个时钟控件 滚动条 ,窗体2 (form2为启动窗口) '请在D:新建文件夹 文件夹下加载10个图片(名字分别为 1、2、3、4、5。
。。。。10) '虽然做的不好 却是用心去做的 以修改了随即问题! Dim i As Integer '要建立的图片框个数 Dim aa As Integer Dim gg As Integer Dim ss As Integer Dim jj As Integer, hh As Integer '保存声明窗体的宽度和长度 Dim tt As Integer '声明时间变量 Dim ff As Integer Dim nn As Integer '声明图片框已经隐藏的变量 Dim kk As String Dim pp As Integer Dim j, uu As Integer Dim tf As Integer, kl As Integer Dim oo As Integer Dim vv As Integer Dim rr, mm As Integer Dim cc As Integer Dim ee, qq As Integer Dim ll As Integer Dim ww As Integer Dim a As Integer Dim mm1, nn1 As Integer Dim ty, yt As Integer Dim strnn As String Dim strmm As String Private Sub Form_Load() On Error GoTo Myerror Me。
Visible = False pp = 0 kk = "。jpg" ProgressBar1。Max = 200 Picture1(0)。Visible = False For i = 1 To 100 pp = pp 1 If pp = 11 Then pp = 1 End If gg = gg 1 If gg = 10 Then ss = ss Picture1(0)。
Height 50 gg = 0 aa = Picture1(0)。Left hh = ss 800 Else aa = aa Picture1(0)。Width 50 jj = aa Picture1(0)。
Width 120 End If Load Picture1(i) Picture1(i)。Picture = LoadPicture("d:新建文件夹" & pp & kk) Picture1(i)。
Width = Picture1(0)。Width Picture1(i)。Height = Picture1(0)。Height Picture1(i)。Left = aa Picture1(i)。
Top = ss Picture1(i)。AutoRedraw = True Picture1(i)。Visible = True If i = 100 Then Picture1(100)。
Left = Picture1(0)。Left Picture1(100)。Top = Picture1(0)。Top Picture1(100)。Height = Picture1(0)。
Height Picture1(100)。Width = Picture1(0)。Width Picture1(100)。Visible = True Picture1(100)。
Picture = LoadPicture("d:新建文件夹" & pp & kk) End If Next i Me。Width = jj Me。Height = hh - 150 ProgressBar1。
Height = 255 ProgressBar1。Width = Me。Width ProgressBar1。Top = hh - 800 ProgressBar1。Left = 0 Timer1。
Interval = 500 Timer2。Interval = 100 Timer1。Enabled = False Randomize Timer2 tt = 200 ProgressBar1。
Value = tt Exit Sub Myerror: MsgBox "D:新建文件夹 文件夹下加载图片", vbOKOnly, "错误对话框“" End End Sub Private Sub Picture1_Click(Index As Integer) nn = 0 pp = 0 Select Case Index Case Index oo = oo 1 If oo = 1 Then ee = Index For vv = 1 To 100 pp = pp 1 If pp = 11 Then pp = 1 End If If vv = Index Then rr = vv tf = pp End If Next End If If oo = 2 Then qq = Index For vv = 1 To 100 pp = pp 1 If pp = 11 Then pp = 1 End If If vv = Index Then mm = vv kl = pp End If Next vv oo = 0 End If If tf = kl Then If ee 0 And ww ww Then mm1 = Picture1(ll)。
Left nn1 = Picture1(ll)。Top ty = Picture1(ww)。Left yt = Picture1(ww)。Top Picture1(ll)。Left = ty Picture1(ll)。
Top = yt Picture1(ww)。Top = nn1 Picture1(ww)。Left = mm1 End If End If End If End Sub。
收起