{ Learn Code. Share Code. Teach Code. Love Code. }

  • Color Palette

  • If you have created any custom controls for VB, C#, C++ or any other language then post them in here.
If you have created any custom controls for VB, C#, C++ or any other language then post them in here.
 #80917  by Usman55
 Wed Mar 26, 2014 8:16 pm
A color palette made into a user control.

If your app needs a color palette, then no need for extensive coding and designing. Get this user control instead. It has the complete functionality of a color palette.

As most image-related apps require, the color palette has 2 color selections, primary and secondary. The secondary color is optional and can be disabled.

If the colors in the color palette are not varied enough, the user can click the Color Dialog button and choose from a variety of colors.

The Color Dialog Button is optional as well. Setting its property to False will disable it and it won't show on the control any more.

I chose the default colors in the palette according to the Paint software in Windows 8. I thought Microsoft has decades of experience and they must have given all the colors quite a thought before choosing those. And that's why I didn't waste my time reinventing the wheel.


If I ever make a future version, it might have the option to add colors from the Color Dialog into extra boxes below the default colors. There could be an option to save those colors on exit and reload the next time the app is launched. Those extra boxes would be optional so they could be disabled if needed.

I made this control for myself to use in my future projects but I'm sharing it so everyone else can benefit from it.
You do not have the required permissions to view the files attached to this post.
 #80918  by comathi
 Wed Mar 26, 2014 8:39 pm
I'd rep you again, but it hasn't been long enough since the last time. Nevertheless, this is a great control, and it looks awesome (almost exactly like the actual colour palette in Paint).

Great work cooll;
 #80919  by Usman55
 Wed Mar 26, 2014 8:45 pm
Thanks, #comathi Maybe some other time! :)

And you're right, I based the whole control on the Windows 8 Paint app. If you noticed, this is identical to the color palettes I used in my Etch A Sketch and Flood The Paint Away apps. But in them, it wasn't a single control and I had to manually write all the code, and arrange them properly on the form. To avoid that in the future, I made it into a control. That's where the idea came from. hehaho;