By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

hiding all controls on a form

P: 86
i want to hide all controls on a form.

is there any code like this to hide all the controls with out writing code from each control


For each control in ....
...
...
next


if so please tell me.

Thanq
Sep 3 '07 #1
Share this Question
Share on Google+
5 Replies


P: 88
Try

Expand|Select|Wrap|Line Numbers
  1.    Dim Control As Object
  2.  
  3.     For Each Control In frmMyForm.Controls
  4.         Control.Visible = False
  5.     Next Control
Sep 3 '07 #2

QVeen72
Expert 100+
P: 1,445
Hi,

Place all the Controls in a Container like "Frame/PictureBox/SSTab Control".. and Hide the Container...

REgards
Veena
Sep 3 '07 #3

P: 86
Expand|Select|Wrap|Line Numbers
  1. For Each Control In frmMyForm.Controls
  2.     Control.Visible = False
  3. Next Control
Thank you.
It worked well.
Sep 3 '07 #4

hariharanmca
100+
P: 1,977
For each control in ....
...
...
next
I think you are looking for
Expand|Select|Wrap|Line Numbers
  1. Form1.Enabled = True or False
Or
Expand|Select|Wrap|Line Numbers
  1. Form1.Visible = True or False
(It seems you are trying all operation in same form like Hide all controls and show new controls, that is not good practice).
Sep 3 '07 #5

debasisdas
Expert 5K+
P: 8,127
i think you are looking for
Expand|Select|Wrap|Line Numbers
  1.  Form1.Enabled = True or False
Or
Expand|Select|Wrap|Line Numbers
  1.  Form1.Visible = True or False
Don't you think that will hide the form itself.

Then what is the use ?
Sep 3 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.