We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How do I fill in the 16 custom colors?System.Windows.Forms.ColorDialog

I want to fill in the 16 custom colors with the System.Windows.Forms.ColorDialog.CustomColors, how would I go about doing that?

I also want to save them back to the System.Windows.Forms.ColorDialog.CustomColors is the use changed the custom colors on on ColorUIControl.  Do you have a sample for doing this?













3 Replies

ST Saravanan T Syncfusion Team August 8, 2014 06:45 AM UTC

Hi Tuan,

 

Thank you for using Syncfusion products,

 

We would like to let you that the custom colors can be set in ColorUIControl by right clicking on the empty cell.  Please have the attached sample and video for your reference.

 

Please follow the below steps to achieve this and let us know if this helps you,

 

1)     Run the sample,

2)     Right click on the empty cell

3)     New dialog box will open.

4)     Pick the color and then click on AddColor

5)     Now selected color will be added in the Custom Colors

 

Please let us know if you have any concerns,

 

Regards,

Saravanan T

 


Attachment: ColorUIControl_CustomColor_Selection_e3830a31.zip


TL Tuan Lam August 8, 2014 04:16 PM UTC

I want to set those programmatically, not selecting from the popup dialog.  I'm using the MFC's color dialog in other apps and I want to transfer those custom color to Syncfusion's ColorUIControl.



ST Saravanan T Syncfusion Team August 11, 2014 11:58 AM UTC

Hi Tuan,

 

Thank you for your update,

 

We would like to let you know that we have modified the sample for your requirement and it can be downloaded from the below attachment.

 

Code Snippet [C#]:

 

this.colorUIControl1.SelectedColorGroup = Syncfusion.Windows.Forms.ColorUISelectedGroup.UserColors;

 

// To set the color

this.colorUIControl1.UserCustomColors[0] = Color.DeepPink;

this.colorUIControl1.UserCustomColors[1] = Color.Blue;

 

 

Please let us know if you need any further assistance,

 

Regards,

Saravanan T
Attachment: ColorUIControl_modified_39f2d282.zip

Loader.
Live Chat Icon For mobile
Up arrow icon