ComboBox.ShortcutMenuBar 屬性 (Access)ComboBox.ShortcutMenuBar property (Access)

您可以使用ShortcutMenuBar屬性來指定當指定之的物件上按一下滑鼠右鍵時顯示快顯功能表。You can use the ShortcutMenuBar property to specify the shortcut menu that appears when you right-click the specified object. 可讀寫的 StringRead/write String.

語法Syntax

運算式快顯功能表expression.ShortcutMenuBar

_運算式_代表**ComboBox** 物件的變數。expression A variable that represents a ComboBox object.

註解Remarks

ShortcutMenuBar屬性適用於僅為表單上的控制項,並不適用於報表上的控制項。The ShortcutMenuBar property applies only to controls on a form, and not to controls on a report.

您也可以使用ShortcutMenuBar屬性來指定用於顯示資料工作表、 表單、 表單控制項或報表的快顯功能表的功能表列巨集。You can also use the ShortcutMenuBar property to specify the menu bar macro that is 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 (" ").

搭配 Application 物件使用時, 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 is displayed in place of the database's global shortcut menu.

您可以將其 ShortcutMenuBar 屬性設定為不同的快顯功能表顯示特定表單、 表單控制項或報表的不同自訂快顯功能表。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 屬性設為 FalseShortcut menus aren't available to any object if the AllowShortcutMenus property is set to False.

範例Example

下列範例會將Suppliers_Toolbar設定為當使用者按一下供應商] 表單上的滑鼠按鈕時要顯示的自訂快顯功能表。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"

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.