Hide all images on userform

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
 
J

Juan Pablo Gonzalez

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.
 
T

Tom Ogilvy

Dim ctrl as Control
for each ctrl in Game.Controls
if typeof ctrl is MSForms.Image
then ctrl.Visible = False
end if
Next
 
J

Jake Marx

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]
 
Top