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

Dim instance As RichTextBox Dim value As Integer value = instance.SelectionHangingIndent instance.SelectionHangingIndent = 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

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.SelectionHangingIndent プロパティを検索する場合は、下記のリンクをクリックしてください。

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