| layout | post |
|---|---|
| title | Getting Started with Windows Forms Color Picker | Syncfusion® |
| description | Learn here about getting started with Syncfusion® Windows Forms Color Picker (ColorPickerUIAdv) control, its elements, and more. |
| platform | windowsforms |
| control | ColorPickerUIAdv |
| documentation | ug |
This section briefly describes how to create a new Windows Forms project in Visual Studio and add ColorPickerUIAdv with its basic functionalities.
Refer to the Control Dependencies section to get the list of assemblies or details of NuGet package that needs to be added as reference to use the control in any application.
Click NuGet Packages to learn how to install nuget packages in Windows Forms application.
-
Create a new Windows Forms application in Visual Studio.
-
The ColorPickerUIAdv control can be added to an application by dragging it from the toolbox to design view. The following dependent assemblies will be added automatically:
- Syncfusion.Grid.Base
- Syncfusion.Grid.Windows
- Syncfusion.Shared.Base
- Syncfusion.Shared.Windows
- Syncfusion.Tools.Base
- Syncfusion.Tools.Windows
It can be added programmatically by performing the following steps.
-
Create a C# or VB application via Visual Studio.
-
Add the following assembly references to the project:
- Syncfusion.Grid.Base
- Syncfusion.Grid.Windows
- Syncfusion.Shared.Base
- Syncfusion.Shared.Windows
- Syncfusion.Tools.Base
- Syncfusion.Tools.Windows
-
Include the required namespace.
{% capture codesnippet1 %} {% tabs %} {% highlight c# %}
using Syncfusion.Windows.Forms.Tools;
{% endhighlight %}
{% highlight vb %}
Imports Syncfusion.Windows.Forms.Tools
{% endhighlight %} {% endtabs %} {% endcapture %} {{ codesnippet1 | OrderList_Indent_Level_1 }}
- Create an instance of ColorPickerUIAdv, and add it to the form.
{% capture codesnippet2 %} {% tabs %} {% highlight c# %}
private Syncfusion.Windows.Forms.Tools.ColorPickerUIAdv colorPickerUIAdv1; ColorPickerUIAdv cpa = new ColorPickerUIAdv(); cpa.Size = new Size(200, 180); this.Controls.Add(cpa);
{% endhighlight %}
{% highlight vb %}
Private colorPickerUIAdv1 As Syncfusion.Windows.Forms.Tools.ColorPickerUIAdv Private cpa As ColorPickerUIadv = New ColorPickerUIadv() Private cpa.Size = New Size(200, 180) Me.Controls.Add(cpa)
{% endhighlight %} {% endtabs %} {% endcapture %} {{ codesnippet2 | OrderList_Indent_Level_1 }}
At run time, a particular color should be focused or selected by using the SelectedColor property.
{% tabs %}
{% highlight C# %}
this.colorPickerUIAdv1.SelectedColor = System.Drawing.Color.White;
{% endhighlight %}
{% highlight vb %}
Me.colorPickerUIAdv1.SelectedColor = System.Drawing.Color.White
{% endhighlight %}
{% endtabs %}


