Commands.CommandInfo(Object, String, Int32) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne le GUID et l'ID de commande associés au contrôle Microsoft.VisualStudio.CommandBars.CommandBar donné.
public:
void CommandInfo(System::Object ^ CommandBarControl, [Runtime::InteropServices::Out] System::String ^ % Guid, [Runtime::InteropServices::Out] int % ID);
void CommandInfo(winrt::Windows::Foundation::IInspectable const & CommandBarControl, [Runtime::InteropServices::Out] std::wstring const & & Guid, [Runtime::InteropServices::Out] int & ID);
[System.Runtime.InteropServices.DispId(5)]
public void CommandInfo (object CommandBarControl, out string Guid, out int ID);
[<System.Runtime.InteropServices.DispId(5)>]
abstract member CommandInfo : obj * string * int -> unit
Public Sub CommandInfo (CommandBarControl As Object, ByRef Guid As String, ByRef ID As Integer)
Paramètres
- CommandBarControl
- Object
Obligatoire. Contrôle Microsoft.VisualStudio.CommandBars.CommandBar associé à la commande.
- Guid
- String
Obligatoire. GUID de la commande.
- ID
- Int32
Obligatoire. ID de la commande.
- Attributs
Exemples
Sub CommandInfoExample()
Dim cmds As Commands
Dim cmdobj As Command
Dim cmdbarobj As CommandBar
Dim cmdbarctl As CommandBarControl
Dim GUID As String
Dim ID As Long
' Set references.
cmds = DTE.Commands
cmdobj = cmds.Item("File.NewFile")
GUID = ""
ID = 0
' Create a toolbar and add the File.NewFile command to it.
cmdbarobj = cmds.AddCommandBar("AACmdBar", _
vsCommandBarType.vsCommandBarTypeToolbar)
MsgBox("Commandbar name: " & cmdbarobj.Name)
cmdbarctl = cmdobj.AddControl(cmdbarobj)
' Assign new GUID and ID to the command bar control.
cmds.CommandInfo(cmdbarctl, GUID, ID)
End Sub