how do i give the user a color chooser for the background of a form or anything else? i would like to be able to give him all colors in vb.net
+1
A:
Most of the commercial toolkits offer skinning - Infragistics, DevExperss, ComponentFactory, Telerik, etc. Some also have free versions.
You can do it yourself as well by
- creating a way to store the desired colors
- giving the users a way to pick the color for each element
- saving their preferences
- retrieving their preference on startup
- applying their preferences to the form controls
With each step you have many choices. One "not too hard" way you could go is:
- create a simple class with properties for each control type's colors i.e. FormBackColor, LabelBackColor, LabelForeColor.
- create a form that has all of your form elements on it. Let them click (or double click) on a control to bring up a dialog that has a color picker on it to set the color or colors.
- save the class to isolated storage
- read the class from isolated storage in your startup code
- create a new form base class that derrives from Form. Inside the load event Loop through its control collection and apply the colors to the controls as you find them.
hope this helps
jcomet
2009-07-31 19:45:17