igColorPicker
Namespace: Wisej.Web.Ext.Ignite
Assembly: Wisej.Web.Ext.Ignite (4.1.0.0)
The igColorPicker is a simple color picker control that displays a palette of colors to select from.
- C#
- VB.NET
public class igColorPicker : igBase
Public Class igColorPicker
Inherits igBase
Constructors
igColorPicker()
Constructs a new instance of the igColorPicker class.
Example:
The following example creates a color picker and replaces the row of standard colors.
var picker = new igColorPicker();
picker.Options.standardColors = new[] { "#ff0000", "#00ff00", "#0000ff", "#ffff00" };
picker.Size = new Size(300, 250);
this.Controls.Add(picker);
igColorPicker(options)
Constructs a new instance of the igColorPicker class using the specified options.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options passed to the igColorPicker widget: an anonymous object, a JSON string or a dynamic object. |
Example:
The following example creates a color picker and handles the colorSelected event to read the color picked by the user.
var picker = new igColorPicker(new
{
standardColors = new[] { "#ff0000", "#00ff00", "#0000ff", "#ffff00" }
});
picker.Instance.onColorSelected += new WidgetEventHandler(this.picker_ColorSelected);
this.Controls.Add(picker);
private void picker_ColorSelected(object sender, WidgetEventArgs e)
{
this.panel1.BackColor = ColorTranslator.FromHtml((string)e.Data.color);
}