Technological Guide.

Color Selector

Color Selector is a small application developed in Visual C# which displays all named color along with a small strip of the color. Upon selecting the color the below panel will be updated with the selected color. As shown in the 2 images.

The DrawItem event of the combo box control has to be implemented in the code and DrawMode property for the combo box control must be set to OwnerDrawFixed in design time in order to let the DrawItem event work.

Design & Coding Application:

Create a Visual C# Windows Forms project in either Visual Studio 2005 / 2008 with Single Form which contains a button (btnLoadColorList), combo box(cmbColorList) and panel (pnlColorTester). Set the DrawMode property of cmbColorList to OwnerDrawFixed and DropDown height property of cmbColorList to 80.

Code for the Form will be as follows.

You can download the sample application developed in Visual Studio 2008 from here.

You may also like to read

 

Leave a Reply