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

ColorPickerButton not setting black color correctly

I have an application where the users can set their own screen colors by using the ColorPickerButton. This includes custom colors outside of the usual "known color" range. The selected color is then stored as an argb number in an XML file which can be read when the screen reloads.

However, the SelectedColor property of the ColorPickerButton appears to convert black to white when displaying the color palette. The following sample code was used to generate the screen shots attached:

Private Sub Form1_Load( _
ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles _
Me.Load

ColorPickerButton1.SelectedColor = Color.FromArgb(255, 255, 255, 255)
' ColorPickerButton1.SelectedColor = Color.FromArgb(255, 0, 0, 0)

End Sub

As you can see both lines of code result in the white colored square being given the focus. Although only a minor problem, black is likely to get heavily used as the color for screen text. The SelectedColor property also appears to work OK with a "KnownColor", but that option is not open to me as users have the choice of potentially 16M colors which are stored as argb's.

I have also noticed that on occasion, other known colors appear to suffer the same problem and although the problem appears random, I suspect that the difficulty with the black/white colors may be the cause.

Any workaround you can provide would be appreciated, otherwise I will create a direct-trac incident if required.

Regards,

Steve Graham



ColorPickerButtonScreenShot_f6d9a589.zip

1 Reply

LS Lingaraj S Syncfusion Team August 17, 2010 12:19 PM UTC

Hi Steve,

Thank you for your interest in Syncfusion products. Also regret for the inconvenience. By default, ColorUIControl does not allow to select the UnKnownColors. So please try using standard KnowColors with ColorUIControl.

this.colorPickerButton1.SelectedColor = Color.Black;


Please let me know if you have any other concerns.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon