Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

ItemCollapsed Event, SftTree Object

An item has been collapsed.

Syntax

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

object

A SftTree object.

ItemIndex

The zero-based index of the item being collapsed.

Comments

The ItemCollapsed event occurs when an item has been collapsed.

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

Examples

VB.NET

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
        AxWindowsMediaPlayer1.Ctlcontrols.pause()
    End If
End Sub

Private Sub AxSftTree1_ItemDblClick(ByVal sender As System.Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_ItemDblClickEvent) Handles AxSftTree1.ItemDblClick
    If e.areaType = SftTreeAreaTypeConstants.constSftTreeColumnRes Then

VB6

End Sub

Private Sub Form_Unload(Cancel As Integer)
    ' clean up
    Unload SavedForm
    Set SavedForm = Nothing
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

C#

            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();
        }

        private void axSftTree1_ItemDblClick(object sender, _DSftTreeEvents_ItemDblClickEvent e) {
            if (e.areaType == (short) SftTreeAreaTypeConstants.constSftTreeColumnRes) {
                axSftTree1.get_Column(e.colIndex).MakeOptimal();

C++

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)
{
    // here we make sure that the media stops playing when the control is not visible
    if (ItemIndex == 2)
        m_WMPDialog.m_pCtlWMP1->controls->pause();
}

void CContentWindowsDlg::OnItemDblClickSfttree1(long ItemIndex, short ColIndex, short AreaType, short Button, short Shift)
{

See Also SftTree Object | Object Hierarchy


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