Hide all images on userform

  • Thread starter Thread starter Jason Morin
  • Start date Start date
J

Jason Morin

Upon initializing, I need to set the visible property for
all images on a user form (named "Game") to false. Having
trouble. Thx.
Jason
 
A very easy way is to do that while you're still in design mode... just
select them all, and set the Visible property to False.
 
Dim ctrl as Control
for each ctrl in Game.Controls
if typeof ctrl is MSForms.Image
then ctrl.Visible = False
end if
Next
 
Hi Jason,

As Juan Pablo noted, you can accomplish this at design time. Here's how you
could do it at runtime:

Private Sub UserForm_Initialize()
Dim ctl As Control

For Each ctl In Controls
If TypeOf ctl Is MSForms.Image _
Then ctl.Visible = False
Next ctl
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top