11.24VBA点灯游戏素材

笨巧果 发表于: 2010-11-23 21:52 来源: 扑奔PPT网

请下载图片附件:

[ 本帖最后由 笨巧果 于 2010-11-24 22:56 编辑 ]

11.24VBA点灯游戏素材

11.24VBA点灯游戏素材

11.24VBA点灯游戏素材 (225 KB, 下载次数: 127)

大家对 11.24VBA点灯游戏素材 的评论
笨巧果 发表于 2010-11-23 22:09:52
Dim pic(1 To 25)
Dim k As Integer
Private Sub CommandButton1_Click()
    For k = 1 To 25
        pic(k) = -1
        ActivePresentation.Slides(1).Shapes.Item("Image" & k).OLEFormat.Object.Visible = True
        ActivePresentation.Slides(1).Shapes.Item("Image" & k).OLEFormat.Object.Picture = LoadPicture(pic(k) & ".jpg")
    Next
    SlideShowWindows(1).View.First
End Sub
Sub change(i As Integer)
    Dim flag As Integer
    pic(i) = -pic(i)
    ActivePresentation.Slides(1).Shapes.Item("Image" & i).OLEFormat.Object.Picture = LoadPicture(pic(i) & ".jpg")
    If i > 5 Then
        pic(i - 5) = -pic(i - 5)
        ActivePresentation.Slides(1).Shapes.Item("Image" & i - 5).OLEFormat.Object.Picture = LoadPicture(pic(i - 5) & ".jpg")
    End If
    If i < 21 Then
        pic(i + 5) = -pic(i + 5)
        ActivePresentation.Slides(1).Shapes.Item("Image" & i + 5).OLEFormat.Object.Picture = LoadPicture(pic(i + 5) & ".jpg")
    End If
    If i Mod 5 <> 1 Then
        pic(i - 1) = -pic(i - 1)
        ActivePresentation.Slides(1).Shapes.Item("Image" & i - 1).OLEFormat.Object.Picture = LoadPicture(pic(i - 1) & ".jpg")
    End If
    If i Mod 5 <> 0 Then
        pic(i + 1) = -pic(i + 1)
        ActivePresentation.Slides(1).Shapes.Item("Image" & i + 1).OLEFormat.Object.Picture = LoadPicture(pic(i + 1) & ".jpg")
    End If
        SlideShowWindows(1).View.First
        flag = 1
    For p = 1 To 25
        If pic(p) = -1 Then
            flag = 0
            Exit For
        End If
    Next
    If flag = 1 Then MsgBox "恭喜过关!"
End Sub
Private Sub Image1_Click()
    Call change(1)
End Sub
Private Sub Image2_Click()
    Call change(2)
End Sub
Private Sub Image3_Click()
    Call change(3)
End Sub
Private Sub Image4_Click()
    Call change(4)
End Sub
Private Sub Image5_Click()
    Call change(5)
End Sub
Private Sub Image6_Click()
    Call change(6)
End Sub
Private Sub Image7_Click()
    Call change(7)
End Sub
Private Sub Image8_Click()
    Call change(8)
End Sub
Private Sub Image9_Click()
    Call change(9)
End Sub
Private Sub Image10_Click()
    Call change(10)
End Sub
Private Sub Image11_Click()
    Call change(11)
End Sub
Private Sub Image12_Click()
    Call change(12)
End Sub
Private Sub Image13_Click()
    Call change(13)
End Sub
Private Sub Image14_Click()
    Call change(14)
End Sub
Private Sub Image15_Click()
    Call change(15)
End Sub
Private Sub Image16_Click()
    Call change(16)
End Sub
Private Sub Image17_Click()
    Call change(17)
End Sub
Private Sub Image18_Click()
    Call change(18)
End Sub
Private Sub Image19_Click()
    Call change(19)
End Sub
Private Sub Image20_Click()
    Call change(20)
End Sub
Private Sub Image21_Click()
    Call change(21)
End Sub
Private Sub Image22_Click()
    Call change(22)
End Sub
Private Sub Image23_Click()
    Call change(23)
End Sub
Private Sub Image24_Click()
    Call change(24)
End Sub
Private Sub Image25_Click()
    Call change(25)
End Sub

[ 本帖最后由 笨巧果 于 2010-11-23 22:29 编辑 ]
嫦娥奔月 发表于 2010-11-24 21:24:51



谢谢果果老师!

198 KB, 下载次数: 82)

601857 发表于 2010-11-24 21:50:01

不是很明白

337 KB, 下载次数: 74)

飘然客 发表于 2010-11-24 21:51:02
谢谢笨巧果老师,交作业了

78.9 KB, 下载次数: 80)

心的 发表于 2010-11-25 00:08:23
十分感谢老师,一直忙到那么晚

403 KB, 下载次数: 54)

卑鄙小人 发表于 2010-11-25 19:14:33


(2010-11-25 19:14:33, Size: 215 KB, Downloads: 102)

tangqingfu 发表于 2011-4-12 18:50:10
谢谢各位的分享!
最新PPT模板
最新贴子
PPT热贴