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:
A byte[] or safe arrays of VT_I1 or VT_UI1 expression that indicates the content of the EBN file. You can use this option when using the EBN file directly in the resources of the project. For instance, the VB6 provides the LoadResData to get the safe array o bytes for specified resource, while in VB/NET or C# the internal class Resources provides definitions for all files being inserted. ( ResourceManager.GetObject("ebn", resourceCulture) ). |
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:
With StatusBar1 .BeginUpdate .Appearance = None2 .VisualAppearance.Add 4,"c:\exontrol\images\border.ebn" .VisualAppearance.Add 5,"CP:4 1 1 -1 -1" .BackColorPanels = 83886080 .BackColor = -2147483633 .Format = "1,2,3,4,(5/6/7/8)" .Debug = True .EndUpdate End WithThe following VB.NET sample shows "How can I change the panel's visual appearance using EBN files":
With AxStatusBar1 .BeginUpdate .Appearance = EXSTATUSBARLib.AppearanceEnum.None2 .VisualAppearance.Add 4,"c:\exontrol\images\border.ebn" .VisualAppearance.Add 5,"CP:4 1 1 -1 -1" .GetOcx().BackColorPanels = &H5000000 .GetOcx().BackColor = &H8000000f .Format = "1,2,3,4,(5/6/7/8)" .Debug = True .EndUpdate End WithThe following C++ sample shows "How can I change the panel's visual appearance using EBN files":
/* Copy and paste the following directives to your header file as it defines the namespace 'EXSTATUSBARLib' for the library: 'ExStatusBar 1.0 Control Library' #import "C:\\WINNT\\system32\\ExStatusBar.dll" using namespace EXSTATUSBARLib; */ EXSTATUSBARLib::IStatusBarPtr spStatusBar1 = GetDlgItem(IDC_STATUSBAR1)->GetControlUnknown(); spStatusBar1->BeginUpdate(); spStatusBar1->PutAppearance(EXSTATUSBARLib::None2); spStatusBar1->GetVisualAppearance()->Add(4,"c:\\exontrol\\images\\border.ebn"); spStatusBar1->GetVisualAppearance()->Add(5,"CP:4 1 1 -1 -1"); spStatusBar1->PutBackColorPanels(83886080); spStatusBar1->PutBackColor(-2147483633); spStatusBar1->PutFormat(L"1,2,3,4,(5/6/7/8)"); spStatusBar1->PutDebug(VARIANT_TRUE); spStatusBar1->EndUpdate();The following C# sample shows "How can I change the panel's visual appearance using EBN files":
axStatusBar1.BeginUpdate(); axStatusBar1.Appearance = EXSTATUSBARLib.AppearanceEnum.None2; axStatusBar1.VisualAppearance.Add(4,"c:\\exontrol\\images\\border.ebn"); axStatusBar1.VisualAppearance.Add(5,"CP:4 1 1 -1 -1"); (axStatusBar1.GetOcx() as EXSTATUSBARLib.StatusBar).BackColorPanels = 0x5000000; (axStatusBar1.GetOcx() as EXSTATUSBARLib.StatusBar).BackColor = 0x8000000f; axStatusBar1.Format = "1,2,3,4,(5/6/7/8)"; axStatusBar1.Debug = true; axStatusBar1.EndUpdate();The following VFP sample shows "How can I change the panel's visual appearance using EBN files":
with thisform.StatusBar1 .BeginUpdate .Appearance = 0 .VisualAppearance.Add(4,"c:\exontrol\images\border.ebn") .VisualAppearance.Add(5,"CP:4 1 1 -1 -1") .BackColorPanels = 83886080 .BackColor = -2147483633 .Format = "1,2,3,4,(5/6/7/8)" .Debug = .T. .EndUpdate endwith