Tuesday 15 March 2011

.net - "variable".Bounds.IntersectsWith -


How can I do my while looping my code while z is a variable?

  function (by zilla as an object) z.Location = zloc z.Hide () zloc = new point (random number (placepace width), random number (placepace.hite)) Zloc.Y & gt; 595 then zloc = new point (random number (placepace width), random number (placepace.heat)) if z.location = zloc while z.bounds.intersectswith (PictureBox1.Bounds, PictureBox2.Bounds, PictureBox3.Bounds) zloc = New Point (Random Number (Placepace Width), Random Number (Placepace.Hite)) z.location = zloc Loop z Location = zloc z.Show () Return (Z) and Function   

The problem is that I can not use ".bounds.intersectswith" on a variable.

Your problem really comes from the fact that to z to Object has been declared as the . Object does not have any properties (okay, only really basic). This is definitely not a border property or method, so you can not use it.

What you have to do is declare it to be z in the actual type (whatever is in your code) and you will be able to use your properties. Otherwise, if you really need to use the object as a logic in your method, then you enter z in the right way in the method, CType (Z, TypeOfZ)) .

With my code, I agree that there is a bounding box of some sort of z ? Anyway, you should declare it as a method, such as

  create a function (bivol jade bounding box) ... if z.Bounds.IntersetcsWith (...) then. . End ... and Function    

No comments:

Post a Comment