HtmlTextWriter.Indent プロパティ
アセンブリ: System.Web (system.web.dll 内)

各行のインデントを設定するタブ位置の数。

インデントは、HtmlTextWriter(TextWriter,String) コンストラクタの tabString パラメータによって指定された文字列を Indent プロパティによって指定された回数だけ書き込んで実行されます。

属性が <span> 要素の開始タグに追加され、RenderBeginTag メソッドが呼び出された場合に、Indent プロパティに割り当てられた値をインクリメントする方法を次のコード例に示します。これによって、<span> 要素内に出力されるすべてのマークアップのインデントが大きくなります。
' Set attributes and values along with attributes and styles ' attribute defined for a <span> element. writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Hello');") writer.AddAttribute("CustomAttribute", "CustomAttributeValue") writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "Red") writer.AddStyleAttribute("CustomStyle", "CustomStyleValue") writer.RenderBeginTag(HtmlTextWriterTag.Span) ' Create a space and indent the markup inside the ' <span> element. writer.WriteLine() writer.Indent += 1
// Set attributes and values along with attributes and styles // attribute defined for a <span> element. writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Hello');"); writer.AddAttribute("CustomAttribute", "CustomAttributeValue"); writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "Red"); writer.AddStyleAttribute("Customstyle", "CustomStyleValue"); writer.RenderBeginTag(HtmlTextWriterTag.Span); // Create a space and indent the markup inside the // <span> element. writer.WriteLine(); writer.Indent++;

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHtmlTextWriter.Indent プロパティを検索する場合は、下記のリンクをクリックしてください。

- HtmlTextWriter.Indent プロパティのページへのリンク