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

Dim instance As RichTextBox Dim value As Integer value = instance.SelectionRightIndent instance.SelectionRightIndent = value
/** @property */ public int get_SelectionRightIndent () /** @property */ public void set_SelectionRightIndent (int value)
public function get SelectionRightIndent () : int public function set SelectionRightIndent (value : int)
現在選択されている内容の右、またはカーソル位置の右に挿入されるインデント幅 (ピクセル単位)。

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

SelectionRightIndent プロパティを使用して 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 right indent in all paragraphs. RichTextBox1.SelectionRightIndent = 20 ' Set the text within the control. RichTextBox1.SelectedText = "All text is indented 20 pixels from the right edge of the RichTextBox." RichTextBox1.SelectedText = "You can use this property with the SelectionIndent property to provide right and left margins." RichTextBox1.SelectedText = "After this paragraph the indentation will end." + ControlChars.CrLf ' Remove all right indentation. RichTextBox1.SelectionRightIndent = 0 RichTextBox1.SelectedText = "This paragraph has no right indentation. All text should flow as normal." End Sub
private void WriteIndentedTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1.Clear(); // Specify a 20 pixel right indent in all paragraphs. richTextBox1.SelectionRightIndent = 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 right edge of the RichTextBox."; richTextBox1.SelectedText = "You can use this property with the SelectionIndent property to provide right and left margins."; richTextBox1.SelectedText = "After this paragraph the indentation will end.\n\n"; // Remove all right indentation. richTextBox1.SelectionRightIndent = 0; richTextBox1.SelectedText = "This paragraph has no right indentation. All text should flow as normal."; }
private: void WriteIndentedTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1->Clear(); // Specify a 20 pixel right indent in all paragraphs. richTextBox1->SelectionRightIndent = 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 right edge of the RichTextBox."; richTextBox1->SelectedText = "You can use this property with the SelectionIndent property to provide right and left margins."; richTextBox1->SelectedText = "After this paragraph the indentation will end.\n\n"; // Remove all right indentation. richTextBox1->SelectionRightIndent = 0; richTextBox1->SelectedText = "This paragraph has no right indentation. All text should flow as normal."; }
private void WriteIndentedTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1.Clear(); // Specify a 20 pixel right indent in all paragraphs. richTextBox1.set_SelectionRightIndent(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 " + "right edge of the RichTextBox."); richTextBox1.set_SelectedText("You can use this property with the " + "SelectionIndent property to provide right and left margins."); richTextBox1.set_SelectedText("After this paragraph the indentation " + "will end.\n\n"); // Remove all right indentation. richTextBox1.set_SelectionRightIndent(0); richTextBox1.set_SelectedText("This paragraph has no right indentation." + "All text should flow as normal."); } //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.SelectionRightIndent プロパティを検索する場合は、下記のリンクをクリックしてください。

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