atesh Posted September 4, 2003 Posted September 4, 2003 hi i have a problem with rich text box formatting. It seems when I format the current text, the previous text that i've formatted goes unformatted. Here's the code: MainBox.Find((UserName.Text & ": "), RichTextBoxFinds.Reverse) Dim fntrb As New Font(MainBox.Font, FontStyle.Bold) MainBox.SelectionFont = fntrb MainBox.SelectionColor = Color.Red So if I have several lines with each one beginning with UserName.Text, each time the line is entered it is supposed to format that part. The problem is after it formats that part the previous lines become unformatted, which I don't want to happen. Quote To err is human, to really foul things up requires a computer.
*Experts* Volte Posted September 4, 2003 *Experts* Posted September 4, 2003 If you are setting the Text properly directly, that is why. If you want existing text to retain its formatting, you will need to use the SelectedText property to append text.With RichTextBox1 .SelectionStart = .Text.Length .SelectedText = "Some Text to Append" 'format the stuff here End With Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.