共用方式為


IVsUIShell.UpdateCommandUI Method

Informs the environment to update the state of the command bars (menus and toolbars).

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'宣告
Function UpdateCommandUI ( _
    fImmediateUpdate As Integer _
) As Integer
'用途
Dim instance As IVsUIShell
Dim fImmediateUpdate As Integer
Dim returnValue As Integer

returnValue = instance.UpdateCommandUI(fImmediateUpdate)
int UpdateCommandUI(
    int fImmediateUpdate
)
int UpdateCommandUI(
    [InAttribute] int fImmediateUpdate
)
abstract UpdateCommandUI : 
        fImmediateUpdate:int -> int 
function UpdateCommandUI(
    fImmediateUpdate : int
) : int

Parameters

  • fImmediateUpdate
    Type: System.Int32
    [in] true if the update is performed synchronously (immediately). It is strongly recommended to pass false for this parameter.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIShell::UpdateCommandUI(
   [in] BOOL fImmediateUpdate
);

This method is equivalent to UpdateUI. It causes the environment to re-query by means of IOleCommandTarget the state of all commands. Typically, the update is not performed immediately but rather delayed until idle time.

.NET Framework Security

See Also

Reference

IVsUIShell Interface

IVsUIShell Members

Microsoft.VisualStudio.Shell.Interop Namespace