• Welcome to Valhalla Legends Archive.
 

Listing colors & examples In a combobox [VB]

Started by haZe, March 29, 2003, 02:13 PM

Previous topic - Next topic

haZe

I noticed that in most bots that have customizable colors, they have a list of all the colors and a sample next to it. How do I do this?

* ss below, taken from Arty Bot

Skywing

Quote from: haze the cow on March 29, 2003, 02:13 PM
I noticed that in most bots that have customizable colors, they have a list of all the colors and a sample next to it. How do I do this?

* ss below, taken from Arty Bot

I recommend that you investigate the ChooseColor common-dialog function in MSDN.

haZe

I did, this is what I got

How do I add all those colors to a combobox though, plus the name?

Skywing

Quote from: haze the cow on March 29, 2003, 02:36 PM
I did, this is what I got

How do I add all those colors to a combobox though, plus the name?
If you want to add them to a combobox, you'll have to do more work (perhaps writing your own function entirely, or using the hook/template/instance members of the CHOOSECOLOR struct).  Most programs use the common dialog functions, and those will benefit from future shell improvements whereas yours will not.  Of course, you might want to maintain a consistant look across all platforms...

dxoigmn

Trying looking into using ComboBoxEx ( http://www.vbaccelerator.com/codelib/odcbolst/comboex.htm ).  Very nice control and should do what you want.  You just have to figure out a way to enumerate the colors or you can just hardcode them in.