Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBox.Item Property

Returns a SftBoxItem object given an item index.

Syntax

Get

VB.NETrefItemObj = object.get_Item(ByVal ItemIndex As Integer) As SftBoxItem
VBSet refItemObj = object.Item(ByVal ItemIndex As Long) As SftBoxItem
C#.NETSftBoxItem refItemObj = object[int ItemIndex];
VC++ISftBoxItem* refItemObj = object->Item[long ItemIndex];
ISftBoxItem* refItemObj = object->GetItem(long ItemIndex);
CHRESULT object->get_Item(long ItemIndex, ISftBoxItem** refItemObj);

object

A SftBox object.

ItemIndex

The zero-based index of the item. The item index is determined by the item's position in the control and is also returned by the methods used to add or insert items.

refItemObj

Returns a reference to the SftBoxItem object for item ItemIndex.

Comments

The Item property returns a SftBoxItem object given an item index.

The properties of the item can be updated using the returned SftBoxItem object.

Certain default properties and behavior for all items can be defined using the SftBoxItems object.

Examples

VB.NET

        Img.Appearance = SftPictureImageConstants.sftImageSortAscDisabled
    End Select
End Sub

Private Sub PropagateImage(ByVal ItemIndex As Integer, ByVal Img As SftPictureObject)

    ' don't use images that are too large in the other areas
    If Img.ActualHeight <= 20 And Img.ActualWidth < 20 Then
        AxSftBox1.get_Item(ItemIndex).Image = Img
        AxSftBox1.get_Item(ItemIndex).LabelImage = Img
        AxSftBox1.get_Item(ItemIndex).RowHeader.Image = Img
    End If
End Sub

Private Sub UpdateImages(ByVal ItemIndex As Integer, ByVal Img As Image, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell

VB6

    Case Else
        ' nothing
    End Select
End Sub

Private Sub PropagateImage(ByVal ItemIndex As Integer, Img As SftPictureObject)
    ' don't use images that are too large in the other areas
    If Img.ActualHeight <= 20 And Img.ActualWidth < 20 Then
        SftBox1.Item(ItemIndex).Image = Img
        SftBox1.Item(ItemIndex).LabelImage = Img
        SftBox1.Item(ItemIndex).RowHeader.Image = Img
    End If
End Sub

Private Sub UpdatePictures(ByVal ItemIndex As Integer, ByVal Pic As StdPicture, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell

C#

        break;
    }
}

private void PropagateImage(int ItemIndex, SftPictureObject Img)
{
    // don't use images that are too large in the other areas
    if (Img.ActualHeight <= 20 && Img.ActualWidth < 20) {
        axSftBox1.get_Item(ItemIndex).Image = Img;
        axSftBox1.get_Item(ItemIndex).LabelImage = Img;
        axSftBox1.get_Item(ItemIndex).RowHeader.Image = Img;
    }
}

private void UpdateImages(int ItemIndex, System.Drawing.Image img, SftBoxHAlignConstants Align)
{

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 SftBox Object | Object Hierarchy


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