Compartir a través de


Command.AddControl(Object, Int32) Method

Definition

Creates a persistent command bar control for the command.

winrt::Windows::Foundation::IInspectable AddControl(winrt::Windows::Foundation::IInspectable const & Owner, int Position = 1);
[System.Runtime.InteropServices.DispId(7)]
public object AddControl (object Owner, int Position = 1);
[<System.Runtime.InteropServices.DispId(7)>]
abstract member AddControl : obj * int -> obj
Public Function AddControl (Owner As Object, Optional Position As Integer = 1) As Object

Parameters

Owner
Object

Required. A CommandBar object to which the new command bar control is to be added.

Position
Int32

Optional. The index position, starting at one, in the command bar to place the new control.

Returns

A CommandBarControl object.

Attributes

Remarks

The environment saves the control and its placement, making it available according to the command's ContextUIGUIDs when the contributing VSPackage is not loaded, or to its responses to the QueryStatus Method when it is loaded.

Applies to