Controls Collection - Toggling Visibility

Category:
Forms and Controls
Type:
Snippets
Difficulty:
Beginning
Author:
Ethan

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
Quickly hiding your controls on a form gives you the flexibility of easily reusing the form. In the calendar app at http://www.freevbcode.com/ShowCode.Asp?ID=2386 the calendar, about and help forms use the same form by hiding and showing controls, thus saving resources. Paste this code onto a project and add controls.

Clicking on the form toggles the visibility of all controls on the form.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: