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

Dim instance As RichTextBox Dim value As Integer value = instance.BulletIndent instance.BulletIndent = value
[LocalizableAttribute(true)] public: property int BulletIndent { int get (); void set (int value); }
/** @property */ public int get_BulletIndent () /** @property */ public void set_BulletIndent (int value)
行頭文字の後にインデント幅として挿入するピクセルの数。既定値は 0 です。


箇条書きスタイルをテキストの段落に適用するには、SelectionBullet プロパティに true を設定してから、テキストに適用するインデント幅をピクセル数で BulletIndent プロパティに設定します。段落には、指定したインデント幅が行頭文字の後に挿入された箇条書きスタイルが適用されます。このプロパティは、コントロールのテキスト内の現在の段落、および箇条書き項目のリストで現在選択されている項目だけに適用されます。箇条書き項目のリスト全体に別のインデント幅を適用するには、BulletIndent プロパティを設定する前に、箇条書き項目のテキストすべてを選択しておく必要があります。

BulletIndent、SelectionFont、SelectedText、および SelectionColor の各プロパティと共に SelectionBullet プロパティを使用して、RichTextBox コントロール内に箇条書きリストを作成する方法を次のコード例に示します。この例では、richTextBox1 という名前の RichTextBox コントロールがフォーム上で作成されている必要があります。
Private Sub WriteTextToRichTextBox() ' Clear all text from the RichTextBox; richTextBox1.Clear() ' Indent bulleted text 30 pixels away from the bullet. richTextBox1.BulletIndent = 30 ' Set the font for the opening text to a larger Arial font; richTextBox1.SelectionFont = New Font("Arial", 16) ' Assign the introduction text to the RichTextBox control. RichTextBox1.SelectedText = "The following is a list of bulleted items:" + ControlChars.Cr ' Set the Font for the first item to a smaller size Arial font. richTextBox1.SelectionFont = New Font("Arial", 12) ' Specify that the following items are to be added to a bulleted list. richTextBox1.SelectionBullet = True ' Set the color of the item text. richTextBox1.SelectionColor = Color.Red ' Assign the text to the bulleted item. richTextBox1.SelectedText = "Apples" + ControlChars.Cr ' Apply same font since font settings do not carry to next line. richTextBox1.SelectionFont = New Font("Arial", 12) richTextBox1.SelectionColor = Color.Orange richTextBox1.SelectedText = "Oranges" + ControlChars.Cr richTextBox1.SelectionFont = New Font("Arial", 12) richTextBox1.SelectionColor = Color.Purple richTextBox1.SelectedText = "Grapes" + ControlChars.Cr ' End the bulleted list. richTextBox1.SelectionBullet = False ' Specify the font size and string for text displayed below bulleted list. richTextBox1.SelectionFont = New Font("Verdana", 10) richTextBox1.SelectedText = "The bulleted text is indented 30 pixels from the bullet symbol using the BulletIndent property." + ControlChars.Cr End Sub
private void WriteTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1.Clear(); // Indent bulleted text 30 pixels away from the bullet. richTextBox1.BulletIndent = 30; // Set the font for the opening text to a larger Arial font; richTextBox1.SelectionFont = new Font("Arial", 16); // Assign the introduction text to the RichTextBox control. richTextBox1.SelectedText = "The following is a list of bulleted items:\n"; // Set the Font for the first item to a smaller size Arial font. richTextBox1.SelectionFont = new Font("Arial", 12); // Specify that the following items are to be added to a bulleted list. richTextBox1.SelectionBullet = true; // Set the color of the item text. richTextBox1.SelectionColor = Color.Red; // Assign the text to the bulleted item. richTextBox1.SelectedText = "Apples" + "\n"; // Apply same font since font settings do not carry to next line. richTextBox1.SelectionFont = new Font("Arial", 12); richTextBox1.SelectionColor = Color.Orange; richTextBox1.SelectedText = "Oranges" + "\n"; richTextBox1.SelectionFont = new Font("Arial", 12); richTextBox1.SelectionColor = Color.Purple; richTextBox1.SelectedText = "Grapes" + "\n"; // End the bulleted list. richTextBox1.SelectionBullet = false; // Specify the font size and string for text displayed below bulleted list. richTextBox1.SelectionFont = new Font("Verdana", 10); richTextBox1.SelectedText = "The bulleted text is indented 30 pixels from the bullet symbol using the BulletIndent property.\n"; }
private: void WriteTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1->Clear(); // Indent bulleted text 30 pixels away from the bullet. richTextBox1->BulletIndent = 30; // Set the font for the opening text to a larger Arial font; richTextBox1->SelectionFont = gcnew System::Drawing::Font( "Arial",16 ); // Assign the introduction text to the RichTextBox control. richTextBox1->SelectedText = "The following is a list of bulleted items:\n"; // Set the Font for the first item to a smaller size Arial font. richTextBox1->SelectionFont = gcnew System::Drawing::Font( "Arial",12 ); // Specify that the following items are to be added to a bulleted list. richTextBox1->SelectionBullet = true; // Set the color of the item text. richTextBox1->SelectionColor = Color::Red; // Assign the text to the bulleted item. richTextBox1->SelectedText = "Apples" "\n"; // Apply same font since font settings do not carry to next line. richTextBox1->SelectionFont = gcnew System::Drawing::Font( "Arial",12 ); richTextBox1->SelectionColor = Color::Orange; richTextBox1->SelectedText = "Oranges" "\n"; richTextBox1->SelectionFont = gcnew System::Drawing::Font( "Arial",12 ); richTextBox1->SelectionColor = Color::Purple; richTextBox1->SelectedText = "Grapes" "\n"; // End the bulleted list. richTextBox1->SelectionBullet = false; // Specify the font size and string for text displayed below bulleted list. richTextBox1->SelectionFont = gcnew System::Drawing::Font( "Verdana",10 ); richTextBox1->SelectedText = "The bulleted text is indented 30 pixels from the bullet symbol using the BulletIndent property.\n"; }
private void WriteTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1.Clear(); // Indent bulleted text 30 pixels away from the bullet. richTextBox1.set_BulletIndent(30); // Set the font for the opening text to a larger Arial font; richTextBox1.set_SelectionFont(new Font("Arial", 16)); // Assign the introduction text to the RichTextBox control. richTextBox1.set_SelectedText("The following is a list of bulleted " + "items:\n"); // Set the Font for the first item to a smaller size Arial font. richTextBox1.set_SelectionFont(new Font("Arial", 12)); // Specify that the following items are to be added to a bulleted list. richTextBox1.set_SelectionBullet(true); // Set the color of the item text. richTextBox1.set_SelectionColor(Color.get_Red()); // Assign the text to the bulleted item. richTextBox1.set_SelectedText("Apples" + "\n"); // Apply same font since font settings do not carry to next line. richTextBox1.set_SelectionFont(new Font("Arial", 12)); richTextBox1.set_SelectionColor(Color.get_Orange()); richTextBox1.set_SelectedText("Oranges" + "\n"); richTextBox1.set_SelectionFont(new Font("Arial", 12)); richTextBox1.set_SelectionColor(Color.get_Purple()); richTextBox1.set_SelectedText("Grapes" + "\n"); // End the bulleted list. richTextBox1.set_SelectionBullet(false); // Specify the font size and string for text displayed below bulleted list. richTextBox1.set_SelectionFont(new Font("Verdana", 10)); richTextBox1.set_SelectedText("The bulleted text is indented 30 pixels" + " from the bullet symbol using the BulletIndent property.\n"); } //WriteTextToRichTextBox

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

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