This documentation is archived and is not being maintained.

Debugger.HexDisplayMode Property

Gets or sets whether expressions are output in hexadecimal or decimal format.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

bool HexDisplayMode { get; set; }
/** @property */
boolean get_HexDisplayMode ()

/** @property */
void set_HexDisplayMode (/** @attribute InAttribute() */ boolean HexModeOn)

function get HexDisplayMode () : boolean

function set HexDisplayMode (HexModeOn : boolean)

Property Value

true if hexadecimal format, otherwise false.

Use HexDisplayMode to determine or set whether expressions are output in hexadecimal or decimal format. HexDisplayMode directly corresponds to the setting in the General, Debugging, Options Dialog Box.

See Expressions in the Debugger for more information.

The following example demonstrates how to use the HexDisplayMode property.

To test this property:

  1. Set a breakpoint in the target application.

  2. Run the target application in the debug mode.

  3. When the application stops at the breakpoint, run the add-in.

public static void HexDisplayMode(DTE dte)
    // Setup the debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Hex Display Mode Test");

    dte.Debugger.HexDisplayMode = false;
    EnvDTE.Expression exp = dte.Debugger.GetExpression("length", true, 1);
    owp.OutputString("Value of variable length in decimal: " + exp.Value);

    dte.Debugger.HexDisplayMode = true;
    exp = dte.Debugger.GetExpression("length", true, 1);
    owp.OutputString("\nValue of variable length in hex: " + exp.Value);