Solved

having a class control a picture in a form

Posted on 2004-04-23
6
199 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

860 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