See Also Example
Applies To
Form, MDI form
Description
Determines whether an object is visible or hidden.
Usage
[form.][control.]Visible[ = boolean ]
Setting
The Visible property settings are:
Setting Description
True (Default) Object is visible.
False Object is hidden.
Remarks
To hide a control at startup, set the Visible property to False at design time. Setting this property in code allows you to hide and later redisplay a control at run time in response to a particular event.
Note Using the Show or Hide method on a form is the same as setting the form's Visible property in code to True or False, respectively.
An MDI child
Data Type
Integer (Boolean)
Help:
Hide Method
Load Statement
Show Method
Programmer's Guide:
Chapter 15, "Creating Graphics for Applications"
The example creates animation using two picture boxes. To try this example, paste the code into the Declarations section of a form that contains two icon-sized picture boxes. Set Name to FileCab for both picture boxes to create an array. Then press F5 and click the picture control to view the animation.
Sub Form_Load ()
Dim I ' Declare variable.
FileCab(0).BorderStyle = 0 ' Set BorderStyle.
FileCab(1).BorderStyle = 0
' Load icons into picture boxes.
FileCab(1).Picture = LoadPicture("icons\office\files03b.ico")
FileCab(0).Picture = LoadPicture("icons\office\files03a.ico")
For I = 0 To 1
FileCab(I).Move 400, 400 ' Place pictures at same spot.
Next I
FileCab(1).Visible = False ' Set to invisible.
FileCab(0).Visible = True ' Set to visible.
End Sub
Sub FileCab_Click (Index As Integer)
Dim I ' Declare variable.
For I = 0 To 1
' Switch the visibility for both pictures.
FileCab(I).Visible = Not FileCab(I).Visible
Next I
End Sub