Originally Posted by knightingale
Can I add more colors/backcolors in the 'Palette'? (in VB 6.0) -Thanks
Are you refereing to the VB IDE Color Palette Presets Dropdown (see picture below).
This is not actually the "palette". It's just a color picker dropdown with a few preset colors. The whole color range is accessed by using the correct hex values.
Is your understanding of how to set hex values (&H00000000) a little rusty? Like how do i change the hex values to get the color you want...?
I posted an extended colors Enum, which will allow you to add some additional color constants to your project.
Normally, there's only a few primary color constants built-in to VB6 like 'vbWhite', 'vbRed', etc. But what if want "vbDarkOrange', or 'vbPaleCyan', or 'vbLightPurple'?
That's where the Enum comes in. It's basically just a list of add-on color constants that allow you to use color names instead of hex values.
The extended Color Enum is on this post (along with an MSDN reference for QBColors):
oh, and since you may be a newbie and are wondering where do I put the Enum? If you have a module in your project it can go at the top of the module code...if you just have a form, it can go at the top of form code (in the General Declarations section, underneath 'Option Explicit' (If you are using 'Option Explicit' which hopefuly you are
Then in the Form Load event it could be used like:
Private Sub Form_Load()
Form1.BackColor = vbPaleYellow