This documentation is archived and is not being maintained.

Trace.IndentSize Property

Gets or sets the number of spaces in an indent.

[Visual Basic]
Public Shared Property IndentSize As Integer
public static int IndentSize {get; set;}
public: __property static int get_IndentSize();
public: __property static void set_IndentSize(int);
public static function get IndentSize() : int;
public static function set IndentSize(int);

Property Value

The number of spaces in an indent. The default is four.


A TextWriterTraceListener interprets this number as spaces. An EventLogTraceListener ignores this value.

This property is stored on per-thread/per-request basis.

To set the AutoFlush and IndentSize for Trace, you can also edit the configuration file that corresponds to the name of your application. The configuration file should be formatted like the following example:

       <trace autoflush="false" indentsize="3" />


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Trace Class | Trace Members | System.Diagnostics Namespace | IndentLevel | Debug | Trace | BooleanSwitch | TraceSwitch | TraceListener | DefaultTraceListener | ConditionalAttribute