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 |
The Skin parameter of the Add method can a STRING as explained bellow, a
BYTE[] / safe arrays of VT_I1 or VT_UI1 expression that indicates the
content of the EBN file.
You can use the BYTE[] / safe arrays of VT_I1 or VT_UI1 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) )
If the Skin parameter points to a string expression, it can be one of the following:
|
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 Appearance = &H2000000 indicates that the second skin object defines the border of the tooltip.
The following VB sample changes the border of the tooltip, using an EBN file:
Private Sub Form_Load() Set t = New EXTOOLTIPLib.ToolTip With t .VisualAppearance.Add &H12, "c:\temp\winword.ebn" t.Appearance = &H12000000 t.BackColor = RGB(255, 255, 255) End With End Sub
The following VB.NET sample changes the border of the tooltip, using an EBN file:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load t = New EXTOOLTIPLib.ToolTip t.VisualAppearance.Add(&H12, "c:\temp\winword.ebn") t.Appearance = &H12000000 t.BackColor = ToUInt32(Color.White) End Sub
where the ToUInt32 function is defined like follows:
Shared Function ToUInt32(ByVal c As Color) As UInt32 Dim i As Long i = c.R i = i + 256 * c.G i = i + 256 * 256 * c.B ToUInt32 = Convert.ToUInt32(i) End Function
The following C# sample changes the border of the tooltip, using an EBN file:
private void Form1_Load(object sender, EventArgs e) { t = new EXTOOLTIPLib.ToolTip(); t.VisualAppearance.Add(0x12, "c:\\temp\\winword.ebn"); t.Appearance = (EXTOOLTIPLib.AppearanceEnum)0x12000000; t.BackColor = ToUInt32(Color.White); }
where the ToUInt32 function is defined like follows:
private UInt32 ToUInt32(Color c) { long i; i = c.R; i = i + 256 * c.G; i = i + 256 * 256 * c.B; return Convert.ToUInt32(i); }
The following C++ sample changes the border of the tooltip, using an EBN file:
void initToolTip() { CoInitialize( NULL ); if ( SUCCEEDED( CoCreateInstance( __uuidof(EXTOOLTIPLib::ToolTip), NULL, CLSCTX_ALL, __uuidof(EXTOOLTIPLib::IToolTip), (LPVOID*)&m_spToolTip ) ) ) { m_spToolTip->VisualAppearance->Add( 0x12, COleVariant( "c:\\temp\\winword.ebn" ) ); m_spToolTip->Appearance = (EXTOOLTIPLib::AppearanceEnum)0x12000000; m_spToolTip->BackColor = RGB(255,255,255); } }
The following VFP sample changes the border of the tooltip, using an EBN file:
public t as Object t = CreateObject("Exontrol.ToolTip") with t .VisualAppearance.Add(0x12,"c:\temp\winword.ebn") .Appearance = 0x12000000 .BackColor = RGB(255,255,255) endwith