Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

having a class control a picture in a form

Posted on 2004-04-23
6
Medium Priority
?
205 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 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

885 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