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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox with Multiple Color Attributes

Status
Not open for further replies.

VBADb

Programmer
Jul 30, 2004
11
US
Hi Everybody,
I have a combo box with a list of products. Some of the products have gone obsolete and I have been asked to change the combo box list to somehow signify these products thru a background color change or a strikethru font. My question: is it possible to have different attributes for individual items in a combolist? Every attempt I've made with the BackColor, ForeColor and Strikethrough attributes applies the change to the complete list not just the new item I'm adding (the list is re-created in a Workbook_Open function). The combo box is a ActiveX object on an Excel spreadsheet using the AddItem method to create the list.

Thanks in advance.
 

Since I haven't had any comments I'm assuming it's not possible to specify attributes for individual items in a combo box list. Guess the next logical step is to just make a 2 column combo box and specify the product status in the second column unless someone has a better suggestion.
 
Don't think you could view seperate colours in the list but you could write some code on the change event that alters the colour AFTER selection - but that would only work if you want to warn them it is not orderable rather than warning them beforehand...

A question back at you though if I may.....
If the products are not orderable, why display them at all ?
Would it be a better idea to remove them from the list altogether ??

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Thanks Geoff,
The product links are to sales histories and the customer doesn't want to archive them just yet... (laughing) couldn't get off the hook that easily!!! Have a good weekend.

George
 
LOL - course they don't - that would be far too sensible !!

In which case, I'm afraid you're stuck with either changing the colour after the event or doing as you have already surmised and adding a 2nd column to show the availability....

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Hold that thought - depends on what the workbook is used for but if the obsolete products are still in the database, can you not amend the routine that adds them into the list to check for their status and not load them if they are obsolete ?? This assumes that they would need to be in the database but wouldn't need to be seen in this particular workbook...

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top