Can a picturebox be passed as an argument of a function?
Printable View
Can a picturebox be passed as an argument of a function?
Yes it sure can:
VB Code:
Private Sub Test(Pic As PictureBox, FilePath As String) Pic.ScaleMode = 3 Pic.Left = 0 Pic.Top = 0 Set Pic.Picture = LoadPicture(FilePath) End Sub Private Sub Form_Load() Test Picture1 End Sub
Shouldn't this be in the regular VB forum?
In fact, you can pass any control as a argument to either a sub or a function.Quote:
Originally Posted by rajabadsha
Probably.Quote:
Originally Posted by nove
OK :) Moved from Games & Graphics.Quote:
Originally Posted by Hack
No the function or sub can be part of a class as well.
What does this mean? :confused:Quote:
Originally Posted by Dnereb