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
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 编辑 ]
谢谢果果老师!
198 KB, 下载次数: 82)
不是很明白
337 KB, 下载次数: 74)
78.9 KB, 下载次数: 80)
403 KB, 下载次数: 54)
(2010-11-25 19:14:33, Size: 215 KB, Downloads: 102)