Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Item Property, SftTree Object

Returns a SftTreeItem object for a given item.

Syntax

Get

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

object

A SftTree object.

ItemIndex

The zero-based item index.

refItemObj

Returns a SftTreeItem object for a given item.

Comments

The Item property returns a SftTreeItem object for a given item.

The SftTreeItem object represents one item in a SftTree/OCX control. Numerous item-specific properties and methods can be accessed using the returned object refItemObj.

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

Examples

VB.NET

Imports Softelvdm.OLEConvert

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim path As String = System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(Application.ExecutablePath)))
    ' Flash
    AxShockwaveFlash1.Movie = path + "\\header.swf"
    AxSftTree1.get_Item(3).Cell(1).AttachContentWindow(AxShockwaveFlash1.Handle, SftTreeContentWindowStyleConstants.contentWindowSftTreeKeepSize)
    AxSftTree1.get_Item(3).Cell(1).Text = ""

    ' Windows Media Player
    AxWindowsMediaPlayer1.URL = path + "\\intermission.wmv"
    AxSftTree1.get_Item(4).Cell(1).AttachContentWindow(AxWindowsMediaPlayer1.Handle, SftTreeContentWindowStyleConstants.contentWindowSftTreeKeepSize)
    AxSftTree1.get_Item(4).Cell(1).Text = ""

VB6

Private Sub Form_Load()

    ' Flash
    ' Because some controls don't have a window handle property (like hWnd),
    ' we place the control inside a picturebox. A picturebox has a window
    ' handle property hWnd.
    ShockwaveFlash1.Movie = App.Path & "\header.swf"
    SftTree1.Item(3).Cell(1).AttachContentWindow FlashPictureBox.hWnd, contentWindowSftTreeKeepSize
    SftTree1.Item(3).Cell(1).Text = ""

    ' Windows Media Player
    WindowsMediaPlayer1.URL = App.Path & "\intermission.wmv"
    SftTree1.Item(4).Cell(1).AttachContentWindow WMPPictureBox.hWnd, contentWindowSftTreeKeepSize
    SftTree1.Item(4).Cell(1).Text = ""

    ' Web Browser

C#

            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e) {

            String path = System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(Application.ExecutablePath)));
            // Flash
            axShockwaveFlash1.Movie = path + "\\header.swf";
            axSftTree1.get_Item(3).get_Cell(1).AttachContentWindow((long) axShockwaveFlash1.Handle, SftTreeContentWindowStyleConstants.contentWindowSftTreeKeepSize);
            axSftTree1.get_Item(3).get_Cell(1).Text = "";

            // Windows Media Player
            axWindowsMediaPlayer1.URL = path + "\\intermission.wmv";
            axSftTree1.get_Item(4).get_Cell(1).AttachContentWindow((long) axWindowsMediaPlayer1.Handle, SftTreeContentWindowStyleConstants.contentWindowSftTreeKeepSize);
            axSftTree1.get_Item(4).get_Cell(1).Text = "";

C++

    m_vTree = m_Tree.GetControlUnknown();
    ASSERT(m_vTree != NULL);

    // Flash

    // Create the dialog containing the Flash control
    if (!m_FlashDialog.Create(IDD_FLASH_DIALOG, &m_Tree) || !m_FlashDialog.HaveFlash()) {
         m_vTree->Item[3]->Cell[1]->Text = _T("Flash ActiveX control could not be instantiated - maybe Flash Player is not installed\n\n")
                                  _T("Flash Player is available at www.adobe.com.");
    } else {
         m_vTree->Item[3]->Cell[1]->Text = _T("");
         m_vTree->Item[3]->Cell[1]->AttachContentWindow((int) m_FlashDialog.m_hWnd, contentWindowSftTreeKeepSize);
    }

    // Windows Media Player

See Also SftTree Object | Object Hierarchy


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


Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.