Userform text colour

Damo10

Active Member
Joined
Dec 13, 2010
Messages
460
Hi,

I have a userform that has several textboxes on it that have several lines of data in each, is it possible to change the font colour of an individual item in a textbox without changing all the items in it?

Regards
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
No, it isn't, I'm afraid. (not with a regular MSForms textbox anyway)
 
Upvote 0
Never occured to me to change individual colors of text in form controls. I expected to find something similar to TextFrame.Characters like in the Shape Object.

Anyhow if this was a label on a form, I would create a picture file containing the multi-colored text and then load the picture file on the Label via its Picture Property. Alternatively, I would use some APIs to render the text over the Label.
 
Upvote 0
you could use several textboxes, and split the text up according to the required font colour. If you ser the textbox.specialeffect to ) (flat), and buttt them up against each other, to the user that looks like a single text box with different fonts. Will work for fixed text, but may not be ideal if the textboxes have variable text in them...
 
Upvote 0
Hi PCC,

I have changed them to listboxes ans now populate them using .additem and they all contain the same ammount or data but how much data does vary depending on what slection the user chooses, I would have liked to have changed the font colour for selections that have been completed but i dont think that this is possible.

Regards
 
Upvote 0
This I guess can only be achieved by using graphical API functions to render colored text but i am not sure about the quality of the output.
 
Upvote 0
Jaafar, the link goes to a workbook that uses labels over listboxes to hightlight particular list items, no API.
 
Upvote 0
Hi mikerickson,

can the text colour of an item be changed when it is being added to the listbox if it meets certain criteria?

Regards
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,881
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top