Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBoxItem.Level Property

Defines the item's level number (indentation).

Syntax

Get

VB.NETLvl = object.Level As Short
VBLvl = object.Level As Integer
C#.NETshort Lvl = object.Level;
VC++short Lvl = object->Level;
short Lvl = object->GetLevel();
CHRESULT object->get_Level(short* Lvl);

Put

VB.NETobject.Level = Lvl As Short
VBobject.Level = Lvl As Integer
C#.NETshort object.Level = Lvl;
VC++short object->Level = Lvl;
void object->PutLevel(short Lvl);
CHRESULT object->put_Level(short Lvl);

object

A SftBoxItem object.

Lvl

Defines the level (indentation) of the item described by object. Valid levels are between 0 and 255.

Comments

The Level property defines the item's level number (indentation).

When a level is assigned to an item, it is automatically indented and connected to a preceding item on a higher level. Connecting tree lines can be enabled using the Items.TreeLineStyle property.

The Level property determines the "indentation" of an item. By changing an item's level number, its parent relation is automatically adjusted by the control. Using this method, the application does not have to manipulate any parent/child relationships, but can instead treat the entire list of items as a linear list, an array of items.

The root (or highest) level is level 0, dependents are on levels 1, 2, 3 and lower.

Examples

VB.NET

    C.Image.Height = 12
    C.ImageHAlign = Align
    PropagateImage(ItemIndex, C.Image)
End Sub

Private Sub AddColor(ByVal Text As String, ByVal Clr As Color)
    Dim i As Integer
    i = AxSftBox1.Items.Add(Text)
    AxSftBox1.get_Item(i).Level = 2
    UpdateColor(i, Clr, SftBoxHAlignConstants.halignSftBoxRight)
End Sub

Private Sub UpdateBuiltinImage(ByVal ItemIndex As Integer, ByVal Style As SftPictureImageConstants, ByVal wPix As Integer, ByVal hPix As Integer, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell
    C = AxSftBox1.get_Cell(ItemIndex, 0)
    C.Image.Appearance = Style

VB6

    C.Image.Height = 12
    C.ImageHAlign = Align
    PropagateImage ItemIndex, C.Image
End Sub

Private Sub AddColor(ByVal Text As String, ByVal Clr As OLE_COLOR)
    Dim I As Integer
    I = SftBox1.Items.Add(Text)
    SftBox1.Item(I).Level = 2
    UpdateColor I, Clr, halignSftBoxRight
End Sub

Private Sub UpdateBuiltinImage(ByVal ItemIndex As Integer, ByVal Style As SftPictureImageConstants, ByVal wPix As Integer, ByVal hPix As Integer, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell
    Set C = SftBox1.Cell(ItemIndex, 0)
    C.Image.Appearance = Style

C#

    C.ImageHAlign = Align;
    PropagateImage(ItemIndex, C.Image);
}

private void AddColor(string Text, Color Clr)
{
    int i;
    i = axSftBox1.Items.Add(Text);
    axSftBox1.get_Item(i).Level = 2;
    UpdateColor(i, Clr, SftBoxHAlignConstants.halignSftBoxRight);
}

private void UpdateBuiltinImage(int ItemIndex, SftPictureImageConstants Style, int wPix, int hPix, SftBoxHAlignConstants Align)
{
    SftBoxCell C = axSftBox1.get_Cell(ItemIndex, 0);
    C.Image.Appearance = Style;

C++

    long ItemIndex = m_vBox->Items->Add("Supported Picture Types");

    m_vBox->Cell[ItemIndex][1]->Text = _T("SftBox/OCX supports numerous image types, such as GDI+ images, bitmaps, icons, ImageLists and also offers numerous built-in images.");

    // add GDI+ samples

    ItemIndex = m_vBox->Items->Add(_T("GDI+ Images"));
    m_vBox->Item[ItemIndex]->Level = 1;
    m_vBox->Cell[ItemIndex][1]->Text = _T("All GDI+ images are supported, like GIF, JPEG, Exif, PNG, TIFF and device-independent bitmaps (up to 64bpp) with semi-transparent and translucent areas.");

    long i = m_vBox->Items->Add(_T("PNG Sample with alpha-channel for translucent edges"));
    m_vBox->Item[i]->Level = 2;
    UpdateImage(i, IDR_PNG_WARNING, halignSftBoxRight);

    i = m_vBox->Items->Add(_T("Another PNG Sample with alpha-channel for translucent edges"));
    m_vBox->Item[i]->Level = 2;

See Also SftBoxItem Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.