RichTextBox.SelectionIndent プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As RichTextBox Dim value As Integer value = instance.SelectionIndent instance.SelectionIndent = value
/** @property */ public int get_SelectionIndent () /** @property */ public void set_SelectionIndent (int value)
現在選択されているテキストの左、またはカーソル位置の左に適用されているインデントの現在の幅 (ピクセル単位)。

テキストが現在選択されていない場合、インデントの設定は、カーソルがある段落と、カーソル位置以降にコントロールに入力されるすべてのテキストに適用されます。プロパティの値が変更されるまで、またはカーソル位置をコントロール内の別の段落に移動するまでの間は、このインデントの設定が適用されます。
コントロール内でテキストが選択されている場合は、選択されているテキスト、およびテキストを選択した後に入力したすべてのテキストに対して、このプロパティの値が適用されます。このプロパティを使用して、RichTextBox のドキュメント内に含まれている段落のインデントを設定できます。このプロパティを SelectionRightIndent と組み合わせて使用すると、段落内に表示される段落を作成できます。
コントロール内の段落にぶら下げインデントを設定するには、SelectionHangingIndent プロパティを使用します。

SelectionIndent プロパティを使用して、RichTextBox 内でインデント テキストを指定する方法を次のコード例に示します。この例では、richTextBox1 という名前の RichTextBox コントロールがフォームに追加されている必要があります。
Private Sub WriteIndentedTextToRichTextBox() ' Clear all text from the RichTextBox; RichTextBox1.Clear() ' Set the font for the text. RichTextBox1.Font = New Font("Lucinda Console", 12) ' Specify a 20 pixel indent in all paragraphs. RichTextBox1.SelectionIndent = 20 ' Set the text within the control. RichTextBox1.SelectedText = "All text is indented 20 pixels from the left edge of the RichTextBox." RichTextBox1.SelectedText = "You can use this property to provide proper indentation such as when writing a letter." RichTextBox1.SelectedText = "After this paragraph the indent is returned to normal spacing." + ControlChars.Crlf RichTextBox1.SelectionIndent = 0 RichTextBox1.SelectedText = "No indenation is applied to this paragraph. All text in the paragraph flows from each control edge." End Sub
private void WriteIndentedTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1.Clear(); // Specify a 20 pixel indent in all paragraphs. richTextBox1.SelectionIndent = 20; // Set the font for the text. richTextBox1.Font = new Font("Lucinda Console", 12); // Set the text within the control. richTextBox1.SelectedText = "All text is indented 20 pixels from the left edge of the RichTextBox."; richTextBox1.SelectedText = "You can use this property to provide proper indentation such as when writing a letter."; richTextBox1.SelectedText = "After this paragraph the indent is returned to normal spacing.\n\n"; richTextBox1.SelectionIndent = 0; richTextBox1.SelectedText = "No indenation is applied to this paragraph. All text in the paragraph flows from each control edge."; }
private: void WriteIndentedTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1->Clear(); // Specify a 20 pixel indent in all paragraphs. richTextBox1->SelectionIndent = 20; // Set the font for the text. richTextBox1->Font = gcnew System::Drawing::Font( "Lucinda Console",12 ); // Set the text within the control. richTextBox1->SelectedText = "All text is indented 20 pixels from the left edge of the RichTextBox."; richTextBox1->SelectedText = "You can use this property to provide proper indentation such as when writing a letter."; richTextBox1->SelectedText = "After this paragraph the indent is returned to normal spacing.\n\n"; richTextBox1->SelectionIndent = 0; richTextBox1->SelectedText = "No indenation is applied to this paragraph. All text in the paragraph flows from each control edge."; }
private void WriteIndentedTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1.Clear(); // Specify a 20 pixel indent in all paragraphs. richTextBox1.set_SelectionIndent(20); // Set the font for the text. richTextBox1.set_Font(new Font("Lucinda Console", 12)); // Set the text within the control. richTextBox1.set_SelectedText("All text is indented 20 pixels from the" + "left edge of the RichTextBox."); richTextBox1.set_SelectedText("You can use this property to provide " + "proper indentation such as when writing a letter."); richTextBox1.set_SelectedText("After this paragraph the indent is " + "returned to normal spacing.\n\n"); richTextBox1.set_SelectionIndent(0); richTextBox1.set_SelectedText("No indenation is applied to this paragraph." + "All text in the paragraph flows from each control edge."); } //WriteIndentedTextToRichTextBox

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


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

- RichTextBox.SelectionIndent プロパティのページへのリンク