Results 1 to 7 of 7

Thread: Can a picturebox be passed as an argument of a function?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    283

    Can a picturebox be passed as an argument of a function?

    Can a picturebox be passed as an argument of a function?

  2. #2
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can a picturebox be passed as an argument of a function?

    Yes it sure can:

    VB Code:
    1. Private Sub Test(Pic As PictureBox, FilePath As String)
    2.  
    3.      Pic.ScaleMode = 3
    4.      Pic.Left = 0
    5.      Pic.Top = 0
    6.      Set Pic.Picture = LoadPicture(FilePath)
    7.  
    8. End Sub
    9.  
    10. Private Sub Form_Load()
    11.  
    12.      Test Picture1
    13.  
    14. End Sub

  3. #3
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    Re: Can a picturebox be passed as an argument of a function?

    Shouldn't this be in the regular VB forum?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Can a picturebox be passed as an argument of a function?

    Quote Originally Posted by rajabadsha
    Can a picturebox be passed as an argument of a function?
    In fact, you can pass any control as a argument to either a sub or a function.
    Quote Originally Posted by nove
    Shouldn't this be in the regular VB forum?
    Probably.

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Can a picturebox be passed as an argument of a function?

    Quote Originally Posted by Hack
    Probably.
    OK Moved from Games & Graphics.


    Has someone helped you? Then you can Rate their helpful post.

  6. #6
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: Can a picturebox be passed as an argument of a function?

    No the function or sub can be part of a class as well.
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Can a picturebox be passed as an argument of a function?

    Quote Originally Posted by Dnereb
    No the function or sub can be part of a class as well.
    What does this mean?

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