vb图片在窗体中随意移动,但不移出窗体
展开全部
添衫蠢信加image控件,加入图片。再添加timer控或轮档迟件。
Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Randomize
Image1.Top = Int(Rnd * (Form1.ScaleHeight + 1 - Image1.Height))
Image1.Left = Int(Rnd * (Form1.ScaleWidth + 1 - Image1.Width))
End Sub
Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Randomize
Image1.Top = Int(Rnd * (Form1.ScaleHeight + 1 - Image1.Height))
Image1.Left = Int(Rnd * (Form1.ScaleWidth + 1 - Image1.Width))
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询