Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Menus
Message
 
À
16/04/2001 13:36:30
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Menus
Divers
Thread ID:
00495860
Message ID:
00495981
Vues:
12
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform