اخي العزيز
لدي اربع صور اريد عند الضغط على نفس الزر تتغير الصور على التوالى بكل ضغطة
حتى تصل الى الصورة الرابعة ثم اضغط على زر 2 تتغير الصور تنازليا
كود:
Dim X, y As Integer
Private Sub Command1_Click()
y = y + 1
If y = 1 Then
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = True
End If
If y = 2 Then
Image1.Visible = False
Image2.Visible = False
Image3.Visible = True
Image4.Visible = False
End If
If y = 3 Then
Image1.Visible = False
Image2.Visible = True
Image3.Visible = False
Image4.Visible = False
End If
If y = 4 Then
Image1.Visible = True
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
End If
If y = 4 Then
y = 4
End If
End Sub
Private Sub Command2_Click()
X = X + 1
If X = 1 Then
Image1.Visible = True
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
End If
If X = 2 Then
Image1.Visible = False
Image2.Visible = True
Image3.Visible = False
Image4.Visible = False
End If
If X = 3 Then
Image1.Visible = False
Image2.Visible = False
Image3.Visible = True
Image4.Visible = False
End If
If X = 4 Then
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = True
End If
If X = 4 Then
X = 4
End If
End Sub