Table of contents
TOC
折叠目录
展开目录

NavigationButton.ShortcutMenuBar 属性 (访问)NavigationButton.ShortcutMenuBar Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

ShortcutMenuBar属性用于指定当您右键单击指定对象时,将出现快捷菜单。读/写,字符串You can use the ShortcutMenuBar property to specify the shortcut menu that will appear when you right-click on the specified object. Read/write String.

语法Syntax

表达式ShortcutMenuBarexpression. ShortcutMenuBar

表达式_一个表示NavigationButton对象的变量。_expression A variable that represents a NavigationButton object.

注解Remarks

请注意ShortcutMenuBar属性仅适用于窗体上的控件不是报表上的控件。Note The ShortcutMenuBar property applies only to controls on a form, not controls on a report.

您可以使用ShortcutMenuBar属性来指定将用于显示数据表、 窗体、 窗体控件或报表的快捷菜单的菜单栏宏。You can also use the ShortcutMenuBar property to specify the menu bar macro that will be used to display a shortcut menu for a datasheet, form, form control, or report.

如果要通过使用宏或 Visual Basic 显示数据库、窗体、窗体控件或报表的内置快捷菜单,请将该属性设置为零长度字符串 (" ")。To display the built-in shortcut menu for a database, form, form control, or report by using a macro or Visual Basic, set the property to a zero-length string (" ").

当用于应用程序对象, ShortcutMenuBar属性可以显示作为全局快捷菜单的自定义快捷菜单。但是,如果已经在数据库中设置的ShortcutMenuBar属性为窗体、 窗体控件或报表,则该对象的自定义快捷菜单将显示数据库的全局快捷菜单的位置上。通过其ShortcutMenuBar属性设置为另一个快捷菜单,可以显示另一个自定义快捷菜单的特定窗体、 窗体控件或报表。当用户单击鼠标按钮,则在窗体、 窗体控件或报表具有焦点时,显示该对象的自定义快捷菜单否则,将显示数据库的全局快捷菜单。When used with the Application object, the ShortcutMenuBar property enables you to display a custom shortcut menu as a global shortcut menu. However, if you've set the ShortcutMenuBar property for a form, form control, or report in the database, the custom shortcut menu of that object will be displayed in place of the database's global shortcut menu. You can display a different custom shortcut menu for a specific form, form control, or report by setting its ShortcutMenuBar property to a different shortcut menu. When the form, form control, or report has the focus, the custom shortcut menu for that object is displayed when the user clicks the right mouse button; otherwise, the global shortcut menu for the database is displayed.

如果将AllowShortcutMenus属性设置为False将快捷菜单不可用的任何对象。Shortcut menus aren't available to any object if the AllowShortcutMenus property is set to False.

示例Example

下面的示例将指定自定义快捷菜单“Suppliers_Toolbar”,该菜单在用户以鼠标右键单击“Suppliers”窗体时显示。The following example sets the "Suppliers_Toolbar" as the custom shortcut menu to display when the user clicks the right mouse button on the "Suppliers" form.

Forms("Suppliers").ShortcutMenuBar = "Suppliers_Toolbar"

另请参阅See also

概念Concepts

NavigationButton 对象NavigationButton Object

© 2018 Microsoft