![]() | Type | Description | ||
| ID as Long | A Long expression that indicates the index of the skin being added or replaced. The value must be between 1 and 126, so Appearance collection should holds no more than 126 elements. | |||
| Skin as Variant | A string expression that indicates the path to the skin file ( *.ebn ), or a string expression that indicates the BASE64 encoded string that holds a skin file ( *.ebn ). Use the Exontrol's exImages tool to build BASE 64 encoded strings on the skin file (*.ebn) you have created. Loading the skin from a file ( eventually uncompressed file ) is always faster then loading from a BASE64 encoded string. The Exontrol's exButton component installs a skin builder that can be used to create new skins. |
![]() | Return | Description | ||
| Boolean | A Boolean expression that indicates whether the new skin was added or replaced. |
The identifier you choose for the skin is very important to be used in the background properties like explained bellow. Shortly, the color properties uses 4 bytes ( DWORD, double WORD, and so on ) to hold a RGB value. More than that, the first byte ( most significant byte in the color ) is used only to specify system color. if the first bit in the byte is 1, the rest of bits indicates the index of the system color being used. So, we use the last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. So, since the 7 bits can cover 127 values, excluding 0, we have 126 possibilities to store an identifier in that byte. This way, a DWORD expression indicates the background color stored in RRGGBB format and the index of the skin ( ID parameter ) in the last 7 bits in the high significant byte of the color. For instance, the BackColor = BackColor Or &H2000000 indicates that we apply the skin with the index 2 using the old color, to the object that BackColor is applied.
The skin method may change the visual appearance for the following parts in the control:
For instance, the following VB sample changes the visual appearance for the
selected item. The SelBackColor property
indicates the selection background color. Shortly, we need to add a skin to
the Appearance object using the Add method, and we need to set the last 7 bits
in the SelBackColor property to indicates the index of the skin that we want
to use. The sample applies the "
"
to the selected item(s):
With Gantt1
With .VisualAppearance
.Add &H23, App.Path + "\selected.ebn"
End With
.SelForeColor = RGB(0, 0, 0)
.SelBackColor = &H23000000
End With
The sample adds the skin with the index 35 ( Hexa 23 ), and applies to the selected item using the SelBackColor property.
The following C++ sample applies a new appearance to the selected item(s):
#include "Appearance.h"
m_gantt.GetVisualAppearance().Add( 0x23, COleVariant(_T("D:\\Temp\\ExGantt_Help\\selected.ebn")) );
m_gantt.SetSelBackColor( 0x23000000 );
m_gantt.SetSelForeColor( 0 );
The following VB.NET sample applies a new appearance to the selected item(s):
With AxGantt1
With .VisualAppearance
.Add(&H23, "D:\Temp\ExGantt_Help\selected.ebn")
End With
.SelForeColor = Color.Black
.Template = "SelBackColor = 587202560"
End With
The VB.NET sample uses the Template property to assign a new value to the SelBackColor property. The 587202560 value represents &23000000 in hexadecimal.
The following C# sample applies a new appearance to the selected item(s):
axGantt1.VisualAppearance.Add(0x23, "D:\\Temp\\ExGantt_Help\\selected.ebn"); axGantt1.Template = "SelBackColor = 587202560";
The following VFP sample applies a new appearance to the selected item(s):
With thisform.Gantt1
With .VisualAppearance
.Add(35, "D:\Temp\ExGantt_Help\selected.ebn")
EndWith
.SelForeColor = RGB(0, 0, 0)
.SelBackColor = .587202560
EndWith
The 587202560 value represents &23000000 in hexadecimal. The 32 value represents &23 in hexadecimal
The screen shot was generated using the following template: