Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Menus
Message
 
To
16/04/2001 13:36:30
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Re: Menus
Miscellaneous
Thread ID:
00495860
Message ID:
00495981
Views:
11
>How can I Loop the Menus in VB?
>
>I want a class that I have created to Loop through the Menus and enable/disable menu bars. I do this in VFP fairly easily. Any code out there that shows me how to do this in VB?
>
>File
>---Print
>---Print Setup
>---
>---Exit
>
>Loop through this in code to disable the items under File that should not be enabled for a form that has no print routine.

You can use this code to cycle through menu items:
Private Sub Command1_Click()
Dim ctlX As Control

    For Each ctlX In Me.Controls
        If TypeName(ctlX) = "Menu" Then
            MsgBox ctlX.Name & ": " & ctlX.Caption
        End If
    Next
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform