|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Pierrick COMBREAU
|
Dec 25, 2010 - 4:19 AM
|
Hello, Elegant DropDownColorPicker and Label have BackColor and UseVisualThemeForBackground properties. Public Overridable Property UseVisualThemeForBackground() As Boolean
Member of Elegant.Ui.Control
Summary:
If true a skinned background is painted; otherwise, it is filled with the color set in the BackColor property. This works for Label, but not for DropDownColorPicker, please check it. Thanks Regards, Robert Volesini
|
|
Technical Support
|
Dec 27, 2010 - 5:29 AM
|
In order to set DropDownColorPicker background to a custom color, you can use the following code: Elegant.Ui.SplitButton splitButton = dropDownColorPicker1.Controls[0] as Elegant.Ui.SplitButton;
if (splitButton != null)
{
splitButton.UseVisualThemeForBackground = false;
splitButton.Button.UseVisualThemeForBackground = false;
splitButton.Button.BackColor = Color.Green;
splitButton.DropDown.UseVisualThemeForBackground = false;
splitButton.DropDown.BackColor = Color.Blue;
}
|
|
Pierrick COMBREAU
|
Dec 27, 2010 - 6:31 AM
|
Thanks for your reply, however it doesn’t work: ’cpFontColor is "Elegant.Ui.DropDownColorPicker"
Dim splitButton As Elegant.Ui.SplitButton = CType(cpFontColor.Controls(0), Elegant.Ui.SplitButton)
Unable to cast object of type ’Elegant.Ui.GalleryDropDown’ to type ’Elegant.Ui.SplitButton’.
Dim splitButton As Elegant.Ui.GalleryDropDown = CType(cpFontColor.Controls(0), Elegant.Ui.GalleryDropDown)
’Elegant.Ui.GalleryDropDown’ is not accessible in this context because it is ’Friend’.
|
|
Technical Support
|
Dec 28, 2010 - 2:43 AM
|
The DropDownColorPicker class supports two styles: drop-down and split-button. It seems that you are using the former. In this case you should use the following code: Elegant.Ui.DropDown dropDown = dropDownColorPicker1.Controls[0] as Elegant.Ui.DropDown;
if (dropDown != null)
{
dropDown.UseVisualThemeForBackground = false;
dropDown.BackColor = Color.Blue;
}
|
|
Pierrick COMBREAU
|
Dec 25, 2010 - 4:22 AM
|
note: ’ Assembly Elegant.Ui.Common, Version 3.8.0.0
Location: C:\Program Files\FOSS Software Inc\Elegant Ribbon\Bin\Core\Elegant.Ui.Common.dll
Name: Elegant.Ui.Common, Version=3.8.0.0, Culture=neutral, PublicKeyToken=3a2b400713aae6e0
|
|