Home > Code Library > SmartMenuXP > Key

Last Update 01 Nov 2001









SmartMenuXP Reference

Key Property

Returns a string that uniquely identifies a menu item.



The Key property syntax has these parts:

Part Description
object An object expression that evaluates to a SmartMenuList object.
menuID A numeric expression that evaluates to a menu item.


Menu items can have an empty string as its key. The key is assigned when the menu item is created.

Private Sub SmartMenuXP1_Click(ByVal ID As Long)

    With SmartMenuXP1.MenuItems
        Select Case .Key(ID)
            Case "keyOpen"
                ' - Open a file...
Case "keySave"
                ' - Save a file...
Case "keyExit"
                ' - Exit the application...
End Select
    End With
End Sub


Copyright © 2001, Andrés Pons (andres@vbsmart.com). All rights reserved.