求VB高手,连连看代码出了点问题,
Dimi,p,x,yAsIntegerDima(26)AsIntegerPrivateSubCommand1_Click()Timer3.Enabled=TrueEndS...
Dim i, p, x, y As Integer
Dim a(26) As Integer
Private Sub Command1_Click()
Timer3.Enabled = True
End Sub
Private Sub Command2_Click()
Timer3.Enabled = False
End Sub
Private Sub Timer3_Timer()
Print
For i = 0 To 26
way1: Randomize
a(i) = Int(Rnd * 27)
If i = 1 Then
If a(0) = a(i) Then
GoTo way1
End If
End If
If i > 1 Then
For p = 0 To i - 1
If a(p) = a(i) Then
GoTo way1
End If
Next p
End If
Image1(i).Picture = LoadPicture(App.Path & "\" & CStr(a(i)) & ".jpg")
Image1(27 + i).Picture = LoadPicture(App.Path & "\" & CStr(a(i)) & ".jpg")
Image1(i).Tag = x
Image1(27 + i).Tag = y
Next i
End Sub
Private Sub image1_Click(Index As Integer)
For i = 0 To 26
If x = y Then
Image1(i).Visible = False
Image1(27 + i).Visible = False
End If
Next i
End Sub
一点击连连看的图片,所有图片就消失了,问题就出在这里, 展开
Dim a(26) As Integer
Private Sub Command1_Click()
Timer3.Enabled = True
End Sub
Private Sub Command2_Click()
Timer3.Enabled = False
End Sub
Private Sub Timer3_Timer()
For i = 0 To 26
way1: Randomize
a(i) = Int(Rnd * 27)
If i = 1 Then
If a(0) = a(i) Then
GoTo way1
End If
End If
If i > 1 Then
For p = 0 To i - 1
If a(p) = a(i) Then
GoTo way1
End If
Next p
End If
Image1(i).Picture = LoadPicture(App.Path & "\" & CStr(a(i)) & ".jpg")
Image1(27 + i).Picture = LoadPicture(App.Path & "\" & CStr(a(i)) & ".jpg")
Image1(i).Tag = x
Image1(27 + i).Tag = y
Next i
End Sub
Private Sub image1_Click(Index As Integer)
For i = 0 To 26
If x = y Then
Image1(i).Visible = False
Image1(27 + i).Visible = False
End If
Next i
End Sub
一点击连连看的图片,所有图片就消失了,问题就出在这里, 展开
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询