Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Count Property, SftTreeColumns Object

Defines the number of columns.

Syntax

Get

VB.NETCols = object.Count As Short
VBCols = object.Count As Integer
C#.NETshort Cols = object.Count;
VC++short Cols = object->Count;
short Cols = object->GetCount();
CHRESULT object->get_Count(short* Cols);

Put

VB.NETobject.Count = Cols As Short
VBobject.Count = Cols As Integer
C#.NETshort object.Count = Cols;
VC++short object->Count = Cols;
void object->PutCount(short Cols);
CHRESULT object->put_Count(short Cols);

object

A SftTreeColumns object.

Cols

Defines the number of columns. The valid range is 1 through 255.

Comments

The Count property defines the number of columns.

The number of columns can only be changed if a tree control is empty. The Items.Clear method can be used to remove all items from a tree control.

Additional columns are always added at the end of the list of columns. Existing column properties are not changed. Default values are used for the new columns added. These can be changed using the column related properties. The last column will be defined using an explicit column width. If an open-ended column is desired, use the ColumnsObj.OpenEnded property to redefine the last column.

Examples

VB.NET

        Dim Menu As System.Windows.Forms.ContextMenu
        Menu = New ContextMenu()
        Dim mItem As System.Windows.Forms.MenuItem

        Dim Count As Integer
        Count = 0
        Dim C As Integer
        For C = 0 To AxSftTree1.ColumnsObj.Count - 1
            mItem = New System.Windows.Forms.MenuItem()
            mItem.Text = AxSftTree1.get_Header(C).Text
            If AxSftTree1.get_Column(C).WidthPix > 0 Then
                mItem.Checked = True
                Count = Count + 1
            Else
                mItem.Checked = False
            End If

C#

        }

        private void HeaderMenu(Point cursor) {

            System.Windows.Forms.ContextMenu menu = new ContextMenu();
            System.Windows.Forms.MenuItem mItem;

            int count = 0;
            for (short c = 0 ; c < axSftTree1.ColumnsObj.Count ; ++c) {
                mItem = new System.Windows.Forms.MenuItem();
                mItem.Text = axSftTree1.get_Header(c).Text;
                if (axSftTree1.get_Column(c).WidthPix > 0) {
                    mItem.Checked = true;
                    ++count;
                } else
                    mItem.Checked = false;

C++

}

void CBookTableDlg::HeaderMenu(CPoint pt)
{
    m_HeaderMenu.DestroyMenu();
    m_HeaderMenu.CreatePopupMenu();

    int count = 0;
    for (short c = 0 ; c < m_vTree->ColumnsObj->Count ; ++c) {

        m_HeaderMenu.AppendMenu(MF_STRING, HEADERMENU_IDS + c, m_vTree->Header[c]->Text);

        if (m_vTree->Column[c]->WidthPix > 0) {
            m_HeaderMenu.CheckMenuItem(HEADERMENU_IDS + c, MF_CHECKED|MF_BYCOMMAND);
            ++count;
        } else

See Also SftTreeColumns Object | Object Hierarchy


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