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

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

RichTextBox.SelectionHangingIndent プロパティ

選択されている段落最初テキスト行の左端から、同じ段落後続行の左端までの距離を取得または設定します

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

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

value = instance.SelectionHangingIndent

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

/** @property */
public void set_SelectionHangingIndent (int
 value)
public function get SelectionHangingIndent
 () : int

public function set SelectionHangingIndent
 (value : int)

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

解説解説
使用例使用例

SelectionHangingIndent プロパティ使用して、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 hanging indent in all paragraphs.
   RichTextBox1.SelectionHangingIndent = 20
   ' Set the text within the control.
   RichTextBox1.SelectedText = "VBThis text contains a hanging
 indent. The first sentence of the paragraph is spaced normally."
   RichTextBox1.SelectedText = "All subsequent lines of text are
 indented based on the value of SelectionHangingIndent."
   RichTextBox1.SelectedText = "After this paragraph the indent
 is returned to normal spacing." + ControlChars.CrLf
   RichTextBox1.SelectedText = "Since this is a new paragraph
 the indent is also applied to this paragraph."
   RichTextBox1.SelectedText = "All subsequent lines of text are
 indented based on the value of SelectionHangingIndent."
End Sub
private void WriteIndentedTextToRichTextBox()
{
   // Clear all text from the RichTextBox;
   richTextBox1.Clear();
   // Specify a 20 pixel hanging indent in all paragraphs.
   richTextBox1.SelectionHangingIndent = 20;
   // Set the font for the text.
   richTextBox1.Font = new Font("Lucinda Console", 12);
   // Set the text within the control.
   richTextBox1.SelectedText = "This text contains a hanging indent. The first
 sentence of the paragraph is spaced normally.";
   richTextBox1.SelectedText = "All subsequent lines of text are indented based
 on the value of SelectionHangingIndent.";
   richTextBox1.SelectedText = "After this paragraph the
 indent is returned to normal spacing.\n";
   richTextBox1.SelectedText = "Since this is a new
 paragraph the indent is also applied to this paragraph.";
   richTextBox1.SelectedText = "All subsequent lines of text are indented based
 on the value of SelectionHangingIndent.";
}
private:
   void WriteIndentedTextToRichTextBox()
   {
      // Clear all text from the RichTextBox;
      richTextBox1->Clear();

      // Specify a 20 pixel hanging indent in all paragraphs.
      richTextBox1->SelectionHangingIndent = 20;

      // Set the font for the text.
      richTextBox1->Font = gcnew System::Drawing::Font( "Lucinda Console",12
 );

      // Set the text within the control.
      richTextBox1->SelectedText = "This text contains a hanging indent.
 The first sentence of the paragraph is spaced normally.";
      richTextBox1->SelectedText = "All subsequent lines of text are indented
 based on the value of SelectionHangingIndent.";
      richTextBox1->SelectedText = "After this paragraph
 the indent is returned to normal spacing.\n";
      richTextBox1->SelectedText = "Since this is a new
 paragraph the indent is also applied to this paragraph.";
      richTextBox1->SelectedText = "All subsequent lines of text are indented
 based on the value of SelectionHangingIndent.";
   }
private void WriteIndentedTextToRichTextBox()
{
    // Clear all text from the RichTextBox;
    richTextBox1.Clear();
    // Specify a 20 pixel hanging indent in all paragraphs.
    richTextBox1.set_SelectionHangingIndent(20);
    // Set the font for the text.
    richTextBox1.set_Font(new Font("Lucinda Console",
 12));
    // Set the text within the control.
    richTextBox1.set_SelectedText("This text contains a hanging indent."
        + "The first sentence of the paragraph is spaced normally.");
    richTextBox1.set_SelectedText("All subsequent lines of text are "
        + "indented based on the value of SelectionHangingIndent.");
    richTextBox1.set_SelectedText("After this paragraph the
 indent is "
        + "returned to normal spacing.\n");
    richTextBox1.set_SelectedText("Since this is a new
 paragraph the indent"
        + "is also applied to this paragraph.");
    richTextBox1.set_SelectedText("All subsequent lines of text are "
        + "indented based on the value of SelectionHangingIndent.");
} //WriteIndentedTextToRichTextBox
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS