PDA

Click to See Complete Forum and Search --> : Objects seen from modules?


MPrestonf12
Aug 20th, 2000, 04:01 PM
In my pong game when the ballhits a ball I have it call a public sub routine but when i say picball.move picball.left + 20 it gives me a error object required. Does the module not see the picball object? Thanks

Sam Finch
Aug 20th, 2000, 04:11 PM
Is picBox a picturebox?

If so the module won't see it directly

you need to specify what form it's on, If it's on form1 you need

Form1.picBall.Move Form1.picBall.Left + 20

kedaman
Aug 21st, 2000, 03:18 AM
Ànother thing you could do is to pass the picturebox reference:

Sub Yoursubwhateveryouhadinthatmodule(picball as picturebox)
picBall.Move picBall.Left + 20
End sub

MPrestonf12
Aug 21st, 2000, 12:29 PM
Thanks both ways work like a charm!