Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

VirtualMode Property, SftTree Object

Defines whether the tree control is in virtual mode.

Syntax

Get

VB.NETBoolean = object.VirtualMode As Boolean
VBBoolean = object.VirtualMode As Boolean
C#.NETbool Boolean = object.VirtualMode;
VC++VARIANT_BOOL Boolean = object->VirtualMode;
VARIANT_BOOL Boolean = object->GetVirtualMode();
CHRESULT object->get_VirtualMode(VARIANT_BOOL* Boolean);

Put

VB.NETobject.VirtualMode = Boolean As Boolean
VBobject.VirtualMode = Boolean As Boolean
C#.NETbool object.VirtualMode = Boolean;
VC++VARIANT_BOOL object->VirtualMode = Boolean;
void object->PutVirtualMode(VARIANT_BOOL Boolean);
CHRESULT object->put_VirtualMode(VARIANT_BOOL Boolean);

object

A SftTree object.

Boolean

Defines whether the tree control is in virtual mode.

BooleanDescription
TrueThe tree control is in virtual mode.
FalseThe tree control is not in virtual mode.

Comments

The VirtualMode property defines whether the tree control is in virtual mode.

In virtual mode, the tree control can be used to display flat lists (without hierarchy) with up to 2,000,000,000 items.

If virtual mode is used, graphics, colors and all tree control data and attributes are provided by the VirtualItem event, which the application must implement to use a virtual data source. This eliminates lengthy initialization when many items are to be displayed.

Examples

VB.NET

    Private m_PicCount As Integer = 0 ' spinning globe index

    Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
        Application.Exit()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        m_PicCount = 0
        AxSftTree1.VirtualMode = True
        AxSftTree1.VirtualCount(10000000)
        AxSftTree1.VirtualImageSizes(16, 16, 16, 16, 16, 16, 16, 16)
        ' Make columns and row headers optimal
        ' but do this at the end of the list, because our sample
        ' data is larger at the end
        AxSftTree1.Items.TopIndex = AxSftTree1.Items.Count - 1
        AxSftTree1.ColumnsObj.MakeOptimal()

VB6

Private Sub Command1_Click()
    End
End Sub

Private Sub Form_Load()
    PicCount = 0
    With SftTree1
        .VirtualMode = True
        .VirtualCount 10000000
        .VirtualImageSizes 16, 16, 16, 16, 16, 16, 16, 16
        ' Make columns and row headers optimal
        ' but do this at the end of the list, because our sample
        ' data is larger at the end
        .Items.TopIndex = .Items.Count - 1
        .ColumnsObj.MakeOptimal
        .RowHeaders.MakeOptimal

C#

        public int m_PicCount;  // spinning globe index

        private void Command1_Click(object sender, System.EventArgs e) {
            Application.Exit();
        }

        private void Form1_Load(object sender, System.EventArgs e) {
            m_PicCount = 0;
            axSftTree1.VirtualMode = true;
            axSftTree1.VirtualCount(10000000);
            axSftTree1.VirtualImageSizes(16, 16, 16, 16, 16, 16, 16, 16);
            // Make columns and row headers optimal
            // but do this at the end of the list, because our sample
            // data is larger at the end
            axSftTree1.Items.TopIndex = axSftTree1.Items.Count - 1;
            axSftTree1.ColumnsObj.MakeOptimal();

C++

    // Set the icon for this dialog.  The framework does this automatically
    //  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE);            // Set big icon
    SetIcon(m_hIcon, FALSE);        // Set small icon

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

    m_vTree->VirtualMode = VARIANT_TRUE;
    m_vTree->VirtualCount(10000000);
    m_vTree->VirtualImageSizes(16, 16, 16, 16, 16, 16, 16, 16);
    // Make columns and row headers optimal
    // but do this at the end of the list, because our sample
    // data is larger at the end
    m_vTree->Items->TopIndex = m_vTree->Items->Count - 1;
    m_vTree->ColumnsObj->MakeOptimal();

See Also SftTree Object | Object Hierarchy


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