Syncfusion.Shared.Base
Members 


Syncfusion.Windows.Forms Namespace : ColorUIControl Class

ColorUIControl Class

Represents a standard interface for selecting colors.
Object Model
ColorUIControl ClassMetroColorTable ClassColorUIControlVisualStyle ClassColorUIControl.ColorCollection ClassColorUIControl.ColorCollection Class
Syntax
'Declaration
 
<ToolboxItemAttribute(True)>
<DesignerAttribute(Syncfusion.Windows.Forms.ColorUIDesigner, System.ComponentModel.Design.IDesigner)>
<ToolboxBitmapAttribute(Syncfusion.Windows.Forms.ColorUIControl, "ToolboxIcons.ColorUIControl.bmp")>
<DescriptionAttribute("Provides a standard interface for selecting colors.")>
<DefaultPropertyAttribute("Text")>
<DefaultEventAttribute("Click")>
<DesignerSerializerAttribute("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>
<ToolboxItemFilterAttribute("System.Windows.Forms")>
<DesignerCategoryAttribute("Component")>
Public Class ColorUIControl 
   Inherits Syncfusion.Windows.Forms.Core.BaseControl
   Implements IVisualStyle, Syncfusion.WinForms.Theme.IThemeProvider 
'Usage
 
Dim instance As ColorUIControl
[ToolboxItem(true)]
[Designer(Syncfusion.Windows.Forms.ColorUIDesigner, System.ComponentModel.Design.IDesigner)]
[ToolboxBitmap(Syncfusion.Windows.Forms.ColorUIControl, "ToolboxIcons.ColorUIControl.bmp")]
[Description("Provides a standard interface for selecting colors.")]
[DefaultProperty("Text")]
[DefaultEvent("Click")]
[DesignerSerializer("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[ToolboxItemFilter("System.Windows.Forms")]
[DesignerCategory("Component")]
public class ColorUIControl : Syncfusion.Windows.Forms.Core.BaseControl, IVisualStyle, Syncfusion.WinForms.Theme.IThemeProvider  
Remarks
The ColorUIControl implements a palette type visual interface for selecting colors at run-time similar to the color picker drop-down provided by the Visual Studio.NET environment. The ColorUIControl class offers a selection of colors divided into three color groupings arranged as tabs. The three color groupings are the SystemColors consisting of the colors defined within the System.Drawing.SystemColors class, the StandardColors consisting of the colors defined within System.Drawing.Color and a CustomColors providing a customizable color palette. The ColorUIControl control can be used either as a regular control hosted within a parent container or it can be used as a drop-down control in combination with the ColorPickerButton control.
Example
The following code creates a ColorUIControl, sets the color groups and adds an event handler for the ColorUIControl.ColorSelected event: private void InitializeColorUIControl() { // Create the ColorUIControl. Syncfusion.Windows.Forms.ColorUIControl clrUIControl = new Syncfusion.Windows.Forms.ColorUIControl(); // Set the ColorGroups to be displayed clrUIControl.ColorGroups = ( Syncfusion.Windows.Forms.ColorUIGroups.CustomColors| Syncfusion.Windows.Forms.ColorUIGroups.StandardColors| Syncfusion.Windows.Forms.ColorUIGroups.SystemColors ); // Set the initially selected group and color. clrUIControl.SelectedColorGroup = Syncfusion.Windows.Forms.ColorUISelectedGroup.SystemColors; clrUIControl.SelectedColor = SystemColors.ControlDark; // Provide a handler for the ColorUIControl.ColorSelected event. clrUIControl.ColorSelected += new EventHandler(this.OnColorSelected); } // Handler for the ColorUIControl.ColorSelected event. private void OnColorSelected(object sender, System.EventArgs e) { Color clrselected = (sender as ColorUIControl).SelectedColor; } Private Sub InitializeColorUIControl() ' Create an instance of the ColorUIControl. Me.clrUIControl = New Syncfusion.Windows.Forms.ColorUIControl() ' Set the color groups to be shown. Me.clrUIControl.ColorGroups = Syncfusion.Windows.Forms.ColorUIGroups.CustomColors Or Syncfusion.Windows.Forms.ColorUIGroups.StandardColors ' Set the initially selected group. Me.clrUIControl.SelectedColorGroup = Syncfusion.Windows.Forms.ColorUISelectedGroup.CustomColors ' Subscribe to the ColorUIControl.ColorSelected event. AddHandler Me.clrUIControl.ColorSelected, New System.EventHandler(AddressOf clrUIControl_ColorSelected) End Sub ' Handler for the ColorUIControl.ColorSelected event. Private Sub clrUIControl_ColorSelected(ByVal sender As Object, ByVal e As System.EventArgs) Dim clrselected As Color = Me.clrUIControl.SelectedColor End Sub 'clrUIControl_ColorSelected
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Windows.Forms.Control
            Syncfusion.Windows.Forms.Core.BaseControl
               Syncfusion.Windows.Forms.ColorUIControl

AssemblyVersion

Syncfusion.Shared.Base: 18.1460.0.42

See Also