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

Dim instance As RichTextBox Dim value As Boolean value = instance.SelectionBullet instance.SelectionBullet = value
/** @property */ public boolean get_SelectionBullet () /** @property */ public void set_SelectionBullet (boolean value)
public function get SelectionBullet () : boolean public function set SelectionBullet (value : boolean)
現在選択されている内容またはカーソル位置に箇条書きスタイルが適用されている場合は true。それ以外の場合は false。

テキストが選択されていない場合、現在のカーソル位置と、カーソル位置以降にユーザーが入力するすべての段落に箇条書きスタイルが適用されます。この箇条書きスタイルは、カーソル位置が移動するまで、またはユーザーが空の箇条書き項目上で Enter キーを押すまでの間、コントロールのテキストに適用されます。
プロパティを設定するときにコントロール内でテキストが選択されている場合は、選択されたテキスト内のすべての段落が、箇条書きリストの箇条書き項目に変換されます。このプロパティを使用して、RichTextBox コントロールで作成したドキュメント内に箇条書きリストを作成できます。
BulletIndent プロパティを使用すると、行頭文字と箇条書き項目のテキストの間に挿入するインデント幅を指定できます。

SelectionFont、SelectedText、および SelectionColor の各プロパティと共に SelectionBullet プロパティを使用して、RichTextBox コントロール内に箇条書きリストを作成する方法を次のコード例に示します。この例では、richTextBox1 という名前の RichTextBox コントロールがフォーム上で作成されている必要があります。
Private Sub WriteTextToRichTextBox() ' Clear all text from the RichTextBox; richTextBox1.Clear() ' 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("Arial", 16) richTextBox1.SelectedText = "Bulleted Text Complete!" End Sub
private void WriteTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1.Clear(); // 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("Arial", 16); richTextBox1.SelectedText = "Bulleted Text Complete!"; }
private: void WriteTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1->Clear(); // 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( "Arial",16 ); richTextBox1->SelectedText = "Bulleted Text Complete!"; }
private void WriteTextToRichTextBox() { // Clear all text from the RichTextBox; richTextBox1.Clear(); // 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("Arial", 16)); richTextBox1.set_SelectedText("Bulleted Text Complete!"); } //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.SelectionBullet プロパティを検索する場合は、下記のリンクをクリックしてください。

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