Valhalla Legends Archive

Programming => General Programming => Topic started by: haZe on March 29, 2003, 02:13 PM

Title: Listing colors & examples In a combobox [VB]
Post by: haZe 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
(http://www.gosugamers.com/colors.JPG)
Title: Re:Listing colors & examples In a combobox [VB]
Post by: Skywing on March 29, 2003, 02:22 PM
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
(http://www.gosugamers.com/colors.JPG)
I recommend that you investigate the ChooseColor common-dialog function in MSDN (http://msdn.microsoft.com/library/default.asp).
Title: Re:Listing colors & examples In a combobox [VB]
Post by: haZe on March 29, 2003, 02:36 PM
I did, this is what I got
(http://www.gosugamers.com/color2.JPG)
How do I add all those colors to a combobox though, plus the name?
Title: Re:Listing colors & examples In a combobox [VB]
Post by: Skywing on March 29, 2003, 02:42 PM
Quote from: haze the cow on March 29, 2003, 02:36 PM
I did, this is what I got
(http://www.gosugamers.com/color2.JPG)
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...
Title: Re:Listing colors & examples In a combobox [VB]
Post by: dxoigmn on March 29, 2003, 03:55 PM
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.