Hi there!
I've created a custom control to visualise some data. I want my control to take on the appearance of the Infragistics controls in my app.
These controls are styled at runtime using an .isl file.
How can I determine for example what the border of an UltraTextEditor control is at runtime, as its Appearance doesn't seem to contain this info!
Cheers,
James
Hi James,
The appearance resolution process is actually quite complicated. The UltraTextEditor considers many factors: the Application style library, it's own appearances, and it's current state (edit mode, hottracking, etc.).
So getting the colors for every possible state really isn't practical.
If you just want to get the basic color, then what I would do is place an UltraTextEditor on the form (or use one that is already on the form, if you already have one). Then you can use the ResolveAppearance method to get the resolved appearance for the control in the normal state:
AppearanceData appearanceData = new AppearanceData(); AppearancePropFlags appearancePropFlags = AppearancePropFlags.AllRender; this.ultraTextEditor1.ResolveAppearance(ref appearanceData, ref appearancePropFlags);
There's no way to get the state-specific appearances, though. So you won't be able to get the HotTracking appearance, for example, unless you call the ResolveAppearance method while the control is currently HotTracked, which would be very difficult, if not impossible.
Mike Saltzman said: Hi James, The appearance resolution process is actually quite complicated. The UltraTextEditor considers many factors: the Application style library, it's own appearances, and it's current state (edit mode, hottracking, etc.). So getting the colors for every possible state really isn't practical. If you just want to get the basic color, then what I would do is place an UltraTextEditor on the form (or use one that is already on the form, if you already have one). Then you can use the ResolveAppearance method to get the resolved appearance for the control in the normal state: AppearanceData appearanceData = new AppearanceData(); AppearancePropFlags appearancePropFlags = AppearancePropFlags.AllRender; this.ultraTextEditor1.ResolveAppearance(ref appearanceData, ref appearancePropFlags); There's no way to get the state-specific appearances, though. So you won't be able to get the HotTracking appearance, for example, unless you call the ResolveAppearance method while the control is currently HotTracked, which would be very difficult, if not impossible.
Hi Mike,
This looked promising for a while, but still doesn't see to work. perhaps I need to explain a bit more...
When I call ResolveAppearance on a text editor, I get nothing back in BorderColor, BorderColor2, BackColor, BackColor2 etc.
All I get is SystemColors.Control for the BorderColor3DBase property, which certainly doesn't match what I can see on screen!!
BTW... I am using v12.1 of the controls (stuck with a corporate standard build that doesn't support .net 4.0)