Freigeben über


Debugger.HexDisplayMode Property

Definition

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

public:
 property bool HexDisplayMode { bool get(); void set(bool value); };
public:
 property bool HexDisplayMode { bool get(); void set(bool value); };
[System.Runtime.InteropServices.DispId(107)]
public bool HexDisplayMode { [System.Runtime.InteropServices.DispId(107)] get; [System.Runtime.InteropServices.DispId(107)] set; }
[<System.Runtime.InteropServices.DispId(107)>]
[<get: System.Runtime.InteropServices.DispId(107)>]
[<set: System.Runtime.InteropServices.DispId(107)>]
member this.HexDisplayMode : bool with get, set
Public Property HexDisplayMode As Boolean

Property Value

true if hexadecimal format, otherwise false.

Attributes

Examples

The following example demonstrates how to use the HexDisplayMode property.

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");  
    owp.Activate();  

    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);  
}  
Shared Sub HexDisplayMode(ByRef dte As EnvDTE.DTE)  
    Dim exp As EnvDTE.Expression  
    dte.Debugger.HexDisplayMode = False  
    exp = dte.Debugger.GetExpression("length", True, 1)  
    MessageBox.Show("Value of variable length in decimal: " + exp.Value, _  
                    "Debugger Test - HexDisplayMode")  
    dte.Debugger.HexDisplayMode = True  
    exp = dte.Debugger.GetExpression("length", True, 1)  
    MessageBox.Show("Value of variable length in hex: " + exp.Value, _  
                    "Debugger Test - HexDisplayMode")  
End Sub  

Remarks

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.

Applies to