Results 1 to 4 of 4

Thread: Objects seen from modules?

  1. #1

    Thread Starter
    Hyperactive Member MPrestonf12's Avatar
    Join Date
    Jun 1999
    Location
    NY
    Posts
    330

    Question

    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
    Matt

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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

    Code:
    Form1.picBall.Move Form1.picBall.Left + 20

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Ànother thing you could do is to pass the picturebox reference:
    Code:
    Sub Yoursubwhateveryouhadinthatmodule(picball as picturebox)
      picBall.Move picBall.Left + 20
    End sub
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    Hyperactive Member MPrestonf12's Avatar
    Join Date
    Jun 1999
    Location
    NY
    Posts
    330

    Thumbs up great!

    Thanks both ways work like a charm!
    Matt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width