'Declaration Public Sub ResolveAppearance( _ ByRef appearance As AppearanceData, _ ByRef requestedProps As AppearancePropFlags _ )
public void ResolveAppearance( ref AppearanceData appearance, ref AppearancePropFlags requestedProps )
Examining the value of an Appearance object property that has not been set will return the "use default" value, not the internal value that is actually being used to display the object affected by the Appearance object. In order to find out what values are being used, you must use the ResolveAppearance method. This method will evaluate the property values of an Appearance object and return an Appearance object with all of its properties set to meaningful values that can be used to determine how the object will look.
When you change the properties of an Appearance object, you are not required to specify a value for every property that object supports. Whether the Appearance object is a stand-alone object you are creating from scratch, or an intrinsic object that is already attached to some other object, you can set certain properties and ignore others. The properties you do not explicitly set are given a "use default" value that indicates there is no specific setting for that property.
Properties that are set to the "use default" value derive their settings from other objects by following an appearance hierarchy. In the appearance hierarchy, each object has a parent object from which it can inherit the actual numeric values to use in place of the "use default" values. The "use default" value should not be confused with the initial setting of the property, which is generally referred to as the default value. In many cases, the default setting of an object's property will be "use default"; this means that the property is initially set not to use a specific value. The "use default" value will be 0 for an enumerated property (usually indicated by a constant ending in the word "default", such as AlignDefault) or -1 (0xFFFFFFFF) for a numeric setting, such as that used by color-related properties.
So for example, if the Appearance object of a cell has its BackColor property set to -1, the control will use the setting of the row's BackColor property for the cell, because the row is above the cell in the appearance hierarchy. The top level of the appearance hierarchy is the UltraWinGrid control itself. If any of the UltraWinGrid's Appearance object properties are set to their "use default" values, the control uses built-in values (the "factory presets") for those properties. For example, the factory preset of the BackColor property of the grid's Appearance object is the system button face color (0x8000000F). This is the value that will be used for the grid's background color when the BackColor property of the grid's Appearance object is set to the "use default" value.
The ResolveAppearance method will return an Appearance object with all of its "use default" settings converted into actual values. It does this by navigating the appearance hierarchy for each property until an explicit setting or a factory preset is encountered. If you simply place a grid on a form, run the project, and examine the setting of the BackColor property of the grid's intrinsic Appearance object:
MsgBox Hex(UltraGrid1.Appearance.BackColor)
...you will see that it is set to the "use default" value (0xFFFFFFFF). However, if you use the ResolveAppearance method to return the same value:
MsgBox Hex(UltraGrid1.ResolveAppearance.BackColor)
...you will see that it is set to the system button face color (0x8000000F). Note that this code takes advantage of the fact that the ResolveAppearance method returns an Appearance object to simplify the code that must be written. This code could be written out in a longer form as follows:
Dim objAppearance as Infragistics.Win.Appearance
Set objAppearance = UltraGrid1.ResolveAppearance
MsgBox Hex(objAppearance.BackColor)
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2