In Windows Forms, the Color structure has a public property for each color. We can use System.Reflection to read all colors of a Color structure and load its properties.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
foreach (System.Reflection.PropertyInfo prop in typeof(Color).GetProperties())
{
if (prop.PropertyType.FullName == "System.Drawing.Color")
comboBox1.Items.Add(prop.Name);
}
}
}
}
Subscribe to:
Post Comments (Atom)
Ajax CalendarExtender displaying at wrong position in Chrome
< script type ="text/javascript" language ="javascript"> function onCalendarShown(sender, args)...
-
Suppose FieldName is the Bit field which tells whether the link should be visible true or false so design your gridview template like th...
-
There is no direct way to Expand/Collapse all panes in Accordion Extender. Using following java script, Accordion can be Expand/Collaps...
-
< script type ="text/javascript" language ="javascript"> function onCalendarShown(sender, args)...
No comments:
Post a Comment