Recently I have to use color picker control in my project so that each user has its own UI. The best color picker example I found on blogger.com. This inspired me to create my own color picker control.
Fig (1) Color picker control.
Color picker allows user to do following thisng. User controls expose the property to show or hide font selction and See Effect Below section. Below image shows only color picker while Font Selection and See Effect Below Setion are hide.
Fig (2) Only color picker, Font Selection and Show Effect section are hide.
User can set the property to display only Font Selection section or Show Effect section or both with color picker control.
User control also expose two server side properties “SelectedColor” and “SelectedFont” that allows aspx page to get selected color and font server side.
<uc1:ucColorPicker ID=”UcColorPicker1” ShowEffectSection=”false” ShowFontSelection=”false” runat=”server” />
Fig (3) User control on aspx page
// User Control Name + “_SelectedColor” and
// User Control Name + “_SelectedFont”
Fig (4) Script shows how to get selected color and font from java script
You can use this in your application to allow user to change his own colors and fonts for UI. Once user has selected color and font you can change these in your CSS file. So this change will immediatle reflects in your application. To achieve this you must have separte CSS for each user.
Here is Color Picker Source Code. Please change the extetion of downloaded file to “zip” and extract it. Create new website in VS 2005 amd click on add existing item from solution. Add both color picker user control and color picker demo aspx page. Set this page as start up page and runt the application.
Happy Programming !!