急求vb中怎样使三个图片来回的变换 有timer的那种 要有具体的程序啊!!
展开全部
Private Sub Timer1_Timer()
Static n As Integer
Dim a(0 To 2) As String
a(0) = "1.jpg"
a(1) = "2.jpg"
a(2) = "3.jpg"
n = n + 1
Picture1.Picture = LoadPicture(a(n Mod 3))
Picture2.Picture = LoadPicture(a((n + 1) Mod 3))
Picture3.Picture = LoadPicture(a((n + 2) Mod 3))
End Sub
Static n As Integer
Dim a(0 To 2) As String
a(0) = "1.jpg"
a(1) = "2.jpg"
a(2) = "3.jpg"
n = n + 1
Picture1.Picture = LoadPicture(a(n Mod 3))
Picture2.Picture = LoadPicture(a((n + 1) Mod 3))
Picture3.Picture = LoadPicture(a((n + 2) Mod 3))
End Sub
2012-12-18
展开全部
Dim i As Long
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
i = i + 1
Picture1.Picture = LoadPicture("d:\" + Trim(Str(i Mod 3)) + ".bmp")
End Sub
'再d盘下要有三个图片,名称分别为0,1,2图片的扩展名为.bmp
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
i = i + 1
Picture1.Picture = LoadPicture("d:\" + Trim(Str(i Mod 3)) + ".bmp")
End Sub
'再d盘下要有三个图片,名称分别为0,1,2图片的扩展名为.bmp
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
'form1窗体中放置四个picturebox控件,一个timer控件
Option ExplicitDim t As Long
Private Sub Form_Load()
Picture1.BackColor = vbRed
Picture2.BackColor = vbGreen
Picture3.BackColor = vbBlack
Timer1.Interval = 500
Timer1.Enabled = True
t = 0
End Sub
Private Sub Timer1_Timer()
If t = 0 Then
Picture4.PaintPicture Picture1.Image, 0, 0‘如果Picture1中有图片,可用Picture1.Picture
ElseIf t = 1 Then
Picture4.PaintPicture Picture2.Image, 0, 0
ElseIf t = 2 Then
Picture4.PaintPicture Picture3.Image, 0, 0
End If
t = (t + 1) Mod 3
End Sub
Option ExplicitDim t As Long
Private Sub Form_Load()
Picture1.BackColor = vbRed
Picture2.BackColor = vbGreen
Picture3.BackColor = vbBlack
Timer1.Interval = 500
Timer1.Enabled = True
t = 0
End Sub
Private Sub Timer1_Timer()
If t = 0 Then
Picture4.PaintPicture Picture1.Image, 0, 0‘如果Picture1中有图片,可用Picture1.Picture
ElseIf t = 1 Then
Picture4.PaintPicture Picture2.Image, 0, 0
ElseIf t = 2 Then
Picture4.PaintPicture Picture3.Image, 0, 0
End If
t = (t + 1) Mod 3
End Sub
更多追问追答
追问
我试了 图片不转换呢 是怎么回事儿呢啊??
追答
如果Picture1中有图片,可用Picture1.Picture
如果Picture2中有图片,可用Picture2.Picture
如果Picture3中有图片,可用Picture3.Picture
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询