Solved

having a class control a picture in a form

Posted on 2004-04-23
6
200 Views
Last Modified: 2010-04-24
im tring to make a picturebox.visible = false in my form1 by coding it in a class instead of the form. Im sure this is a stupid question but i cant seem to get the class to identify the picturebox, im missing something.
0
Comment
Question by:saber2x
  • 2
6 Comments
 
LVL 3

Expert Comment

by:Lektran
ID: 10907133
Public Sub HidePicture(ByRef pic as PictureBox)
                pic.Visible = False
End Sub

to call:
HidePicture(picturebox)
0
 

Author Comment

by:saber2x
ID: 10914389
this doesnt quite work, im tring to do like 50 pictures and i want to shrink the code in my form...example im currently doing this picturebox2.visible = false .. .. .. .. picturebox50.visible = false, what i want to do is call a class, and in the class set all the pictures to false...but it doesnt detect my pictures...
0
 
LVL 3

Accepted Solution

by:
Lektran earned 25 total points
ID: 10914416
dim ctrl as Control
For Each ctrl in Me.Controls
           If TypeOf ctrl is PictureBox Then
                       ctrl.Visible = False
            End If
Next
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.net Open Folder in Windows Explorer 3 92
VB.NET Textbox input validation 4 61
VB.net Open video relating to control 2 29
vb.net background worker crossthread 11 25
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question