Solved

having a class control a picture in a form

Posted on 2004-04-23
6
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

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

Suggested Solutions

Title # Comments Views Activity
VB.net Excel VSTO Add-in version compatability 2 39
Stop Git from being my repository 1 51
Help with Report Viewer in VS2013 6 34
Datatable / Dates ? 4 33
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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