Is there any way to retrieve the RGB values of a particular control or UI Element in an application that is using the AppStylist?
For example, I'd like to grab the RGB values from the SplitterBarAppearance BackColor property of an UltraDockManager, however the property is set to Default in the designer.
Thanks,
Jim
Hi Jim,
jlitzie said:I would assume attempting to use the Infragistics.Win.AppStyling.StyleManager object itself to get a value would also be difficult (or impossible)?
It could be very tricky, because you would essentially have to duplicate the same resolution process that the control uses. Unless you already know what UIRole you are using inside the style library so you can go to it directly.
jlitzie said:Might there be a way of drilling down to a UiElement object to get these values?
You could use a DrawFilter and trap for the drawing of the element you want and then look at the drawParams.AppearanceData. But this will only fire when the element is actually drawn on the screen, and it will fire every time the cell paints. So it can be done, but it's not very efficient.
Thanks Mike.
I would assume attempting to use the Infragistics.Win.AppStyling.StyleManager object itself to get a value would also be difficult (or impossible)?
Might there be a way of drilling down to a UiElement object to get these values?
To get the actual on-screen color of an object, it has to be resolved. Most of the WinForms controls and sub-objects expose methods like ResolveAppearance or ResolveCellAppearance to allow you to get the resolved appearance data.
Not all of these methods are exposed publicly, though. I took a look for ResolveSplitterBarAppearance on the UltraDockManager, and it looks like it's internal. So there's currently no way to get this color without using Reflection.
You should Submit an incident to Infragistics Developer Support and report this so they can get it corrected.
If you know that the color is coming from AppStylist, then you could also try to get the color from the Style Library itself. But you would have to know which role to look at, and it's possible that the color potentially might come from several roles, so this would get pretty complex pretty fast, depending on how much you know, or can assume, about the Style Library you are using.