-
January 22nd, 2018, 05:42 PM
#1
Inserting Text to the beginning of a RichTextBox maintaining colors
I have the following code:
Code:
txtStatusLog.SelectionStart = 0
txtStatusLog.SelectionLength = 0
txtStatusLog.SelectedText = ("ERROR: " & MyUpdate & "(" & Now & ")" & vbCrLf)
txtStatusLog.SelectionColor = Color.Red
Only problem is that when a different color is selected, the color either never appears or changes the entire text box that color. Any ideas on how to correct this?
-
January 22nd, 2018, 06:03 PM
#2
Re: Inserting Text to the beginning of a RichTextBox maintaining colors
Looks like it works if I change the order a bit:
Code:
txtStatusLog.SelectionStart = 0
txtStatusLog.SelectionLength = 0
txtStatusLog.SelectionColor = Color.Red
txtStatusLog.SelectedText = ("ERROR: " & MyUpdate & "(" & Now & ")" & vbCrLf)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|