-
Jun 27th, 2022, 08:04 AM
#1
Thread Starter
Hyperactive Member
-
Jun 27th, 2022, 08:07 AM
#2
Re: How do you create a command that hides each label on the surface of the form?
Code:
Label.Visible = False
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jun 27th, 2022, 08:14 AM
#3
Thread Starter
Hyperactive Member
Re: How do you create a command that hides each label on the surface of the form?
Originally Posted by Zvoni
Code:
Label.Visible = False
Thank you
I know that, but I want one thing that hides everyone
-
Jun 27th, 2022, 08:23 AM
#4
Re: How do you create a command that hides each label on the surface of the form?
There is no "one thing that hides everything".
you have to iterate either through
a) your Control-Array of Labels, setting each Member to invisible
b) the Control-Collection of the Form containig all Controls, check for Type "Label", then make it invisible
....and in my answer are some hints hidden for you.....
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jun 27th, 2022, 09:10 AM
#5
Re: How do you create a command that hides each label on the surface of the form?
You can put the labels in a borderless frame, and then set the frame to not be visible which will hide all the controls parented in the frame.
Last edited by passel; Jun 27th, 2022 at 10:57 AM.
"Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930
-
Jun 27th, 2022, 09:19 AM
#6
Thread Starter
Hyperactive Member
Re: How do you create a command that hides each label on the surface of the form?
Originally Posted by Mysystem
Thank you
I know that, but I want one thing that hides everyone
Thank you
-
Jun 27th, 2022, 09:19 AM
#7
Thread Starter
Hyperactive Member
Re: How do you create a command that hides each label on the surface of the form?
Originally Posted by passel
You put the labels in a borderless frame, and then set the frame to not be visible which will hide all the controls parented in the frame.
Thank you
-
Jun 27th, 2022, 10:06 AM
#8
Addicted Member
Re: How do you create a command that hides each label on the surface of the form?
Code:
Private Sub Command1_Click()
ShowControlType "Label", False
End Sub
Private Sub ShowControlType(ControlType As String, ShowControl As Boolean)
Dim c As Control
For Each c In Controls
If TypeName(c) = ControlType Then c.Visible = ShowControl
Next
End Sub
-
Jun 28th, 2022, 06:28 AM
#9
Thread Starter
Hyperactive Member
Re: How do you create a command that hides each label on the surface of the form?
Originally Posted by argen
Code:
Private Sub Command1_Click()
ShowControlType "Label", False
End Sub
Private Sub ShowControlType(ControlType As String, ShowControl As Boolean)
Dim c As Control
For Each c In Controls
If TypeName(c) = ControlType Then c.Visible = ShowControl
Next
End Sub
Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|