Bobby Heid
bheid at appdevgrp.com
Wed Feb 15 10:37:05 CST 2006
I think you will have to a owner-drawn combo box. Not sure if you can do that in access. Here are some samples: Color Picker by Owner Drawn List Box and Combo Box (MFC/C++) http://www.codeproject.com/combobox/colorpicker.asp Owner Draw Combo and List Boxes Version 2.1 (VB5/6) http://tinyurl.com/8733q http://www.vbaccelerator.com/home/vb/Code/Controls/Combo_and_List_Boxes/Owne r_Draw_Combo_and_List_Box/article.asp Change the Style of a Control / Owner Drawn Controls (VB5/6) http://www.thescarms.com/vbasic/OwnerDrawn.asp Virtual Listbox Demo.zip (34KB) This project shows how you can create an owner drawn virtual listbox that allows you to set the color of each item to any color you want dynamically. It is based on Matt Hart's concept of hooking the WM_CREATE message for VB controls to enable changing window styles that can only be set when a control is created. This technique was published in the July, 1999 issue of the VBPJ. I have taken the concept a step further and encapsulated it in a user control. The listbox is also "virtual" in the sense that the items it displays are actually kept in a separate array. The list only calls for the text of an item when it needs to be drawn. This is very useful for situations where you have a large number of items that would require a long time to load into a regular listbox. This demo uses subclassing techniques so, If you don't already have it, you will want to get the Debug Object (Dbgwproc.dll) DLL to allow stepping through subclassed code in break mode in the VB IDE. http://www.mvps.org/vbvision/_samples/Virtual_Listbox_Demo.zip (Found at http://www.mvps.org/vbvision/grouped_demos.htm) Bobby -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin - Beach Access Software Sent: Tuesday, February 14, 2006 11:58 PM To: Access Developers discussion and problem solving Subject: [SPAM SUSPECT] Re: [AccessD] Colors in a combo box Importance: Low Stuart: I showed it to him. Option frames were a new idea. He thought that was a really neat control - especially the part about the value being associated with the button that you could read in code. Stuff we take for granted. But he likes the combo boxes better. Of course, now that he's got the value lists all set up he doesn't want to redo it. :) I would be neat if you could drop down a list of colors or more generally, embedded graphics. So you could pick from a list of pictures. Access 2007? Thanks Rocky Stuart McLachlan wrote: > On 14 Feb 2006 at 17:45, Rocky Smolin - Beach Access S wrote: > > >> Dear List: >> >> Can you make a combo box display a list of colored boxes? Noah's >> putting together a program to give the value of a resistor if you select the >> colors of the rings. The combo box is currently a list of the colors. But >> it would be much cooler if it dropped down the colors instead of a list. Is >> this possible? >> >> > > I think you will have to do something with stacking columns of labels, - > wait a minute........... > > How about something like this: > http://www.lexacorp.com.pg/Resistor.gif > > Option Groups, Radio buttons and coloured labels. > Up to you to do the maths, but you can have a copy of the form if you want > it <g> > > > -- Rocky Smolin