views:

54

answers:

2

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: 

There's a ColorDialog control in the toolbox.

Robert Harvey
+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

  1. creating a way to store the desired colors
  2. giving the users a way to pick the color for each element
  3. saving their preferences
  4. retrieving their preference on startup
  5. applying their preferences to the form controls

With each step you have many choices. One "not too hard" way you could go is:

  1. create a simple class with properties for each control type's colors i.e. FormBackColor, LabelBackColor, LabelForeColor.
  2. 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.
  3. save the class to isolated storage
  4. read the class from isolated storage in your startup code
  5. 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