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
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
Useful Forum Tips: - If you found any post that was useful, please consider rating their post - Give sensible thread titles, please! - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB. - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post. - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator (VB6) || *NEW* Video Game Making Tips (VB6 & VB.Net) || World of Warcraft Spell Cooldown Effect (VB.Net 2008, 2010 & VB6) || *NEW* Flappy Bird (VB.Net) Lets make a Sega Genesis Emulator! (VB6 & VB.Net) Expert. Ask me anything NES! My Smilies:
Shouldn't this be in the regular VB forum?
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. Originally Posted by nove Shouldn't this be in the regular VB forum? Probably.
Originally Posted by Hack Probably. OK Moved from Games & Graphics.
Has someone helped you? Then you can Rate their helpful post.
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.
Originally Posted by Dnereb No the function or sub can be part of a class as well. What does this mean?
Forum Rules