Greetings!
I just want to ask on how to change a word to another word and change its color in a textbox. For example if I type the word "Yes" in the text box it will change to "NO" and change its color into red at the same time.
glenndr_15
0
Newbie Poster
Recommended Answers
Jump to PostYou can do a simple replace on the string:
textBox.Text = textBox.Text.Replace("Yes", "NO")
Changing the color is a different matter. I assume you want to change only the replaced text to red, which won't work unless you're using a rich text box. If it's just a …
All 4 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
glenndr_15
0
Newbie Poster
azareth
5
Posting Whiz in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.