Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change the color of a portion of text in label box

Status
Not open for further replies.

BrianJH

Programmer
May 26, 2003
26
US
Hello,
I know how to change the color of the entire text in my label box:

**************
*My Label Box *
**************
public label1 as new label

public sub doit()
label1.text = "My Label Box"
label1.forecolor = **whatever color**
end sub

BUT I want to change the color on only a portion of the text:

**************
*my label box * change the color of the bold text
**************

any ideas? I have no clue!

Thank you,

Brian
 
You might try using a RichText box control... it will allow you to select portions of the text and format them, just like you're wanting. You could set it to be a Read-only box on the form, and remove the border, etc. so that it looks like a label, if that's what you really want... but I don't think the standard label is capable of what you're asking.

Ben

If you pull the wings off a fly, would you have to call it a "walk"?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top