如何使我的代码中的 do while 循环与 z 作为变量一起工作?
Function make(ByVal z As Object)
z.Location = zloc
z.Hide()
zloc = New Point(RandomNumber(playspace.Width), RandomNumber(playspace.Height))
If zloc.Y > 595 Then
zloc = New Point(RandomNumber(playspace.Width), RandomNumber(playspace.Height))
End If
z.location = zloc
Do While z.bounds.intersectswith(PictureBox1.Bounds, PictureBox2.Bounds, PictureBox3.Bounds)
zloc = New Point(RandomNumber(playspace.Width), RandomNumber(playspace.Height))
z.location = zloc
Loop
z.Location = zloc
z.Show()
Return (z)
End Function
问题是我不能在变量上使用“.bounds.intersectswith”。