I want a picturebox to randomly appear anywhere on the screen (within the frame) after my timer's interval has finished. How can I do this??????????
Printable View
I want a picturebox to randomly appear anywhere on the screen (within the frame) after my timer's interval has finished. How can I do this??????????
[code]
Private Sub Timer1_Timer()
dim XMax
dim YMax
XMax=Frame1.Width - Picture1.Width
YMax=Frame1.Height - Picture1.Height
Randomize
Picture1.Left=int(rnd*xmax)
Randomize
picture1.Top=int(rnd*ymax)
End Sub
If you only want your picturebox to be positioned randomly, you'd also want to stick a
into Sastraxi's code.Code:Timer1.Enabled = False
- jamie