Library code snippets
A quick way to toggle visibility
If you want show something when its hidden, or hide it if its showing you may
do this:If Control1.Visible = True Then
Control1.Visible = False
ElseIf Control1.Visible = False Then
Control1.Visible = True
End If
However, a quicker way is to do:Control1.Visible = Not Control1.Visible
Also, if you have a menu like 'View Toolbar' you can use the resultant visibility
to set the checkmark on it. For Example
Private Sub mnuViewToolbar_Click()
tbToolbar.Visible = Not tbToolbar.Visible
mnuViewToolbar.Checked = tbToolbar.Visible
End Sub
By the way, if you make the item visible in the first place, make sure the menu
is checked by default.
Related articles
Related discussion
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
-
Can you describe Above simple VB6 code?
by pramodmca09 (0 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
My knowledge of VBA is very poor so I was wondering if someone could advise me how to disable menu items such as those that drop down from the FILE or TOOLS menus or even the whole menu.
What I would like to happen is that the menu item remains on the drop down list but is greyed out and disabled.
I hope that this makes sense.
This thread is for discussions of A quick way to toggle visibility.