Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

ItemExpanded Event, SftTree Object

An item has been expanded.

Syntax

VB.NETPrivate Sub object_ItemExpanded(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.ItemExpanded
VBPrivate Sub object_ItemExpanded(ByVal ItemIndex As Long)
C#.NETvoid object_ItemExpanded(object sender, EventArgumentType e);
VC++void OnItemExpandedobject(long ItemIndex);
CHRESULT OnItemExpandedobject(long ItemIndex);

object

A SftTree object.

ItemIndex

The zero-based index of the item being expanded.

Comments

The ItemExpanded event occurs when an item has been expanded.

This is a notification only. No tree control items or cells should be manipulated while handling this event.

Examples

VB.NET

    AxSftTree1.Items.Current = 0 ' select the first item
    AxSftTree1.get_Item(0).Selected = True

    AxSftTree1.Dock = DockStyle.Fill ' Maximize the main window

    Me.WindowState = FormWindowState.Maximized
End Sub

Private Sub AxSftTree1_ItemExpanded(ByVal sender As System.Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_ItemExpandedEvent) Handles AxSftTree1.ItemExpanded
    If e.itemIndex = 2 Then
        AxWindowsMediaPlayer1.Ctlcontrols.play()
    End If
End Sub

Private Sub AxSftTree1_ItemCollapsed(ByVal sender As System.Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_ItemCollapsedEvent) Handles AxSftTree1.ItemCollapsed
    If e.itemIndex = 2 Then

VB6

End Sub

Private Sub SftTree1_ItemCollapsed(ByVal ItemIndex As Long)
    If ItemIndex = 2 Then
        ' Here we make sure that the media stops playing when the control is not visible
        WindowsMediaPlayer1.Controls.pause
    End If
End Sub
Private Sub SftTree1_ItemExpanded(ByVal ItemIndex As Long)
    If ItemIndex = 2 Then
        ' Here we make sure that the media starts playing when the control is visible
        WindowsMediaPlayer1.Controls.Play
    End If
End Sub

Private Sub SftTree1_ItemDblClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer)

C#

            axSftTree1.Items.Current = 0; // select the first item
            axSftTree1.get_Item(0).Selected = true;

            axSftTree1.Dock = DockStyle.Fill; // Maximize the main window

            this.WindowState = FormWindowState.Maximized;
        }

        private void axSftTree1_ItemExpanded(object sender, _DSftTreeEvents_ItemExpandedEvent e) {
            if (e.itemIndex == 2)
                axWindowsMediaPlayer1.Ctlcontrols.play();
        }

        private void axSftTree1_ItemCollapsed(object sender, _DSftTreeEvents_ItemCollapsedEvent e) {
            if (e.itemIndex == 2)
                axWindowsMediaPlayer1.Ctlcontrols.pause();

C++

void CContentWindowsDlg::OnSize(UINT nType, int cx, int cy)
{
    CDialog::OnSize(nType, cx, cy);

    if (m_Tree.m_hWnd)
        m_Tree.MoveWindow(0, 0, cx, cy);
}

void CContentWindowsDlg::OnItemExpandedSfttree1(long ItemIndex)
{
    // Here we make sure that the media stops playing when the control is not visible
    if (ItemIndex == 2)
        m_WMPDialog.m_pCtlWMP1->controls->play();
}

void CContentWindowsDlg::OnItemCollapsedSfttree1(long ItemIndex)

See Also SftTree Object | Object Hierarchy


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