共用方式為


ContextMenuService.SetContextMenu(DependencyObject, ContextMenu) 方法

定義

設定所指定物件之 ContextMenu 屬性的值。

public:
 static void SetContextMenu(System::Windows::DependencyObject ^ element, System::Windows::Controls::ContextMenu ^ value);
public static void SetContextMenu (System.Windows.DependencyObject element, System.Windows.Controls.ContextMenu value);
static member SetContextMenu : System.Windows.DependencyObject * System.Windows.Controls.ContextMenu -> unit
Public Shared Sub SetContextMenu (element As DependencyObject, value As ContextMenu)

參數

element
DependencyObject

要設定屬性的物件。

value
ContextMenu

要設定的值。

適用於