Link to home
Start Free TrialLog in
Avatar of Kail
Kail

asked on

color and font style in a textbox

Is there any way to either change the color or font style(i.e. bold) of specific pieces of text in a textbox?  

I'd like to change certain words to appear as bold or in a different color.

Thanks.
Avatar of Dr. Kamal Mehdi
Dr. Kamal Mehdi
Flag of Greece image

If you use the standard text box, it is not possible.
You must use the rich text box control.
Regards.
Avatar of Kail
Kail

ASKER

Well then how do I do it with a Rich Text Box?
use rich text box.

i give you a small program.

richtextbox1.Text = "Hello my friend!"
richtextbox1.font.bold = true
richtextbox1.SelStart = 0
richtextbox1.SelLength = 5
richtextbox1.SelColor = vbBlue
richtextbox1.SelStart = 6
richtextbox1.SelLength = 2
richtextbox1.SelColor = vbGreen
richtextbox1.SelStart = 9
richtextbox1.SelLength = 7
richtextbox1.SelColor = vbRed
richtextbox1.SelStart = 11

ASKER CERTIFIED SOLUTION
Avatar of adityau
adityau

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Couldn't you wiat a little bit???
Yeah, I agree with you, but Kail accepted the answer. (Even though, I gave my comment -- the answer)