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

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

RichTextBox.SelectionIndent プロパティ

選択開始される行のインデント長さ (ピクセル単位) を取得または設定します

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

Dim instance As RichTextBox
Dim value As Integer

value = instance.SelectionIndent

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

/** @property */
public void set_SelectionIndent (int
 value)
public function get SelectionIndent
 () : int

public function set SelectionIndent
 (value : int)

プロパティ
現在選択されているテキストの左、またはカーソル位置の左に適用されているインデント現在の幅 (ピクセル単位)。

解説解説
使用例使用例

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
RichTextBox クラス
RichTextBox メンバ
System.Windows.Forms 名前空間
SelectionRightIndent
RichTextBox.SelectionHangingIndent プロパティ


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS