vb Picture1显示图片问题
在pictures\文件夹,有2张图片打个比方Picture1.Picture=LoadPicture(App.Path&"\pictures\MgI.jpg")Pict...
在pictures\文件夹,有2张图片
打个比方
Picture1.Picture = LoadPicture(App.Path & "\pictures\MgI.jpg")
Picture1.Picture = LoadPicture(App.Path & "\pictures\MgI1.jpg")
想让这2张图片循环互换也就是,每1秒钟互换一次,代码应该怎么写 ,说白了就像放电影的道理一样
窗体有Picture1,有两个按键,一个时钟控键,按键1开始,按键2结束 展开
打个比方
Picture1.Picture = LoadPicture(App.Path & "\pictures\MgI.jpg")
Picture1.Picture = LoadPicture(App.Path & "\pictures\MgI1.jpg")
想让这2张图片循环互换也就是,每1秒钟互换一次,代码应该怎么写 ,说白了就像放电影的道理一样
窗体有Picture1,有两个按键,一个时钟控键,按键1开始,按键2结束 展开
展开全部
timer1.in....=1000
sub timer1_time
if pic1.image=App.Path & "\pictures\MgI.jpg" then
pic1.image=LoadPicture(App.Path & "\pictures\MgI1.jpg")
else
pic1.image=LoadPicture(App.Path & "\pictures\MgI.jpg")
endif
end sub
sub command1_click
timer1.enable=true
end sub
sub command2_click
timer1.enable=false
end sub
sub timer1_time
if pic1.image=App.Path & "\pictures\MgI.jpg" then
pic1.image=LoadPicture(App.Path & "\pictures\MgI1.jpg")
else
pic1.image=LoadPicture(App.Path & "\pictures\MgI.jpg")
endif
end sub
sub command1_click
timer1.enable=true
end sub
sub command2_click
timer1.enable=false
end sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Timer1_Timer()
static i as integer
i=(i+1) mod 2
if i=0 then
Picture1.Picture = LoadPicture(App.Path & "\pictures\MgI.jpg")
else
Picture1.Picture = LoadPicture(App.Path & "\pictures\MgI1.jpg")
end if
End Sub
Private Sub Command1_Click()
timer1.enbled=true
timer1.interval=1000
End Sub
Private Sub Command2_Click()
timer1.enbled=false
End Sub
static i as integer
i=(i+1) mod 2
if i=0 then
Picture1.Picture = LoadPicture(App.Path & "\pictures\MgI.jpg")
else
Picture1.Picture = LoadPicture(App.Path & "\pictures\MgI1.jpg")
end if
End Sub
Private Sub Command1_Click()
timer1.enbled=true
timer1.interval=1000
End Sub
Private Sub Command2_Click()
timer1.enbled=false
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询