RichTextBox.SelectionRightIndent プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > RichTextBox.SelectionRightIndent プロパティの意味・解説 

RichTextBox.SelectionRightIndent プロパティ

RichTextBox コントロール右端から、選択されているテキスト右端または現在のカーソル位置追加されテキスト右端までの距離 (ピクセル単位)。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Property SelectionRightIndent As
 Integer
Dim instance As RichTextBox
Dim value As Integer

value = instance.SelectionRightIndent

instance.SelectionRightIndent = value
public int SelectionRightIndent { get;
 set; }
public:
property int SelectionRightIndent {
    int get ();
    void set (int value);
}
/** @property */
public int get_SelectionRightIndent ()

/** @property */
public void set_SelectionRightIndent (int
 value)
public function get SelectionRightIndent
 () : int

public function set SelectionRightIndent
 (value : int)

プロパティ
現在選択されている内容の右、またはカーソル位置の右に挿入されるインデント幅 (ピクセル単位)。

解説解説
使用例使用例

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からRichTextBox.SelectionRightIndent プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からRichTextBox.SelectionRightIndent プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からRichTextBox.SelectionRightIndent プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

RichTextBox.SelectionRightIndent プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



RichTextBox.SelectionRightIndent プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS