Find all Colors From your System

Santosh4u
Posted by Santosh4u under C# category on | Views : 1573
hi
This code will help u to find all the BorderStyle Available in VS 2005.
Drag a list box called(lstFontColor ) and a button called ( btnLoadColor) from tool box
under button click write the below code.
protected void btnLoadColor_Click(object sender, EventArgs e)
{
string[] colorArray = Enum.GetNames(typeof(KnownColor));
lstFontColor .DataSource = colorArray;
lstFontColor.DataBind();

}

Ragards
Santosh

Comments or Responses

Posted by: Poster on: 10/8/2009 Level:Starter | Status: [Member]
Just to make the above code snippet working properly, here is the modified version.

        string[] colorArray = Enum.GetNames(typeof(System.Drawing.KnownColor));

dropColor.DataSource = colorArray;
dropColor.DataBind();


KnownColor enumeration is in the System.Drawing namespace.

Thank you.

Login to post response