Question How do I change partial text color from within an output string?

mcapone888

Member
Joined
Jun 17, 2011
Messages
10
Programming Experience
Beginner
Hi everyone. I am a novice hobbyist with vb.net, so please excuse my terminology. I have a read only richtextbox, let's cal it rtbTest. I want to change the text in it at runtime to: rtbTest.Text = "I am running a test. Please wait." However, I want the word test to be red. I know the proper way to do this (using multiple line outside of the text property value), but (and I am hoping I am explaining this correct) I want to change the color from within the text string itself. So I want it to look something like this: rtbTest.Text = "I am running a " & Color.Red & "test" & Color.White & ". Please wait." or maybe even rtbTest.Text = "I am running a test. Please wait." I know these two snippets do not work, but I hope you understand what I am trying to do. I want to change just a portion of the text to a different color from within just the one line of the .Text property value. Is this possible? Thanks. (((Sorry - I am entered text with paragraphs, but my post is being stuck into one big paragraph)))
 
Back
Top