Richtextbox Settings problem

G

Guest

I pasted the following code (from a Microsoft example) in the load event of my form, but when I run the app, none of the settings, such as font size, color, etc. take effect, except for the bulletted list.

' Clear all text from the RichTextBox;
rtbSetUpInstructions.Clear()
' Set the font for the opening text to a larger Arial font;
rtbSetUpInstructions.SelectionFont = New Font("Arial", 16)
' Assign the introduction text to the RichTextBox control.
rtbSetUpInstructions.SelectedText = "The following is a list of bulleted items:" + ControlChars.Cr
' Set the Font for the first item to a smaller size Arial font.
rtbSetUpInstructions.SelectionFont = New Font("Arial", 12)
' Specify that the following items are to be added to a bulleted list.
rtbSetUpInstructions.SelectionBullet = True
' Set the color of the item text.
rtbSetUpInstructions.SelectionColor = Color.Red
' Assign the text to the bulleted item.
rtbSetUpInstructions.SelectedText = "Apples" + ControlChars.Cr
' Apply same font since font settings do not carry to next line.
rtbSetUpInstructions.SelectionFont = New Font("Arial", 12)
rtbSetUpInstructions.SelectionColor = Color.Orange
rtbSetUpInstructions.SelectedText = "Oranges" + ControlChars.Cr
rtbSetUpInstructions.SelectionFont = New Font("Arial", 12)
rtbSetUpInstructions.SelectionColor = Color.Purple
rtbSetUpInstructions.SelectedText = "Grapes" + ControlChars.Cr
' End the bulleted list.
rtbSetUpInstructions.SelectionBullet = False
' Specify the font size and string for text displayed below bulleted list.
rtbSetUpInstructions.SelectionFont = New Font("Arial", 16)
rtbSetUpInstructions.SelectedText = "Bulleted Text Complete!"

Am I missing anything. I haven't done any modifications to the original code.

Thanks
 
G

Guest

Also, I did Import System.Drawing.Color and I had also placed the rtfbox on a panel control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top