SftTree/OCX 7.5 Documentation

Display
Print

Cell Property, SftTree Object

Returns a SftTreeCell object for a given item/column.

Syntax

Get

VB.NETrefCellObj = object.get_Cell(ByVal ItemIndex As Integer, ByVal ColIndex As Short) As SftTreeCell
VBSet refCellObj = object.Cell(ByVal ItemIndex As Long, ByVal ColIndex As Integer) As SftTreeCell
C#.NETSftTreeCell refCellObj = object.Cell[int ItemIndex][short ColIndex];
VC++ISftTreeCell* refCellObj = object->Cell[long ItemIndex][short ColIndex];
ISftTreeCell* refCellObj = object->GetCell(long ItemIndex, short ColIndex);
CHRESULT object->get_Cell(long ItemIndex, short ColIndex, ISftTreeCell** refCellObj);

object

A SftTree object.

ItemIndex

The zero-based index of the item. The combination of ItemIndex and ColIndex describes an individual cell.

ColIndex

The zero-based column number. The combination of ItemIndex and ColIndex describes an individual cell.

refCellObj

Returns a SftTreeCell object for a given item/column.

Comments

The Cell property returns a SftTreeCell object for a given item/column.

The SftTreeCell object represents one cell in a SftTree/OCX control. Numerous cell-specific properties and methods can be accessed using the returned object refCellObj.

A SftTreeCell object can also be obtained through an item's Item.Cell property.

Certain default properties and behavior for cells can be defined using the SftTreeColumn object.

Examples

VB.NET

                Counter = Counter + 1
                If Counter > 50 Then ' only add up to 50
                    Exit For
                End If
                Dim ItemIndex As Integer
                ItemIndex = AxSftTree1.Items.Add(ff.Name)
                AxSftTree1.get_Item(ItemIndex).Level = 1
                ' set the font
                AxSftTree1.get_Cell(ItemIndex, 0).Font = OLECvt.ToIFontDisp(newFont)
                ' set the font name in column 1
                AxSftTree1.get_Cell(ItemIndex, 1).Text = ff.Name
            End If
        Next

        AxSftTree1.BulkUpdate = False
        ' make column widths optimal

VB6

        MaxFonts = Screen.FontCount
        ' limit to 20 fonts
        If MaxFonts > 20 Then MaxFonts = 20
        For I = 0 To MaxFonts - 1
            ' add the item
            ItemIndex = .Items.Add(Screen.Fonts(I))
            .Item(ItemIndex).Level = 1
            ' set the cell name and font in column 0
            Set C = .Cell(ItemIndex, 0)
            C.Font.Name = Screen.Fonts(I)
            ' not bold
            C.Font.Bold = False
            ' 10 pt
            C.Font.Size = 10
            ' set the font name in column 1
            .Cell(ItemIndex, 1).Text = Screen.Fonts(I)

C#

                    newFont = null;
                }
                if (newFont != null) {
                    if (++counter > 50)  // only add up to 50
                        break;
                    int itemIndex = axSftTree1.Items.Add(ff.Name);
                    axSftTree1.get_Item(itemIndex).Level = 1;
                    // set the font
                    axSftTree1.get_Cell(itemIndex, 0).Font = OLECvt.ToIFontDisp(newFont);
                    // set the font name in column 1
                    axSftTree1.get_Cell(itemIndex, 1).Text = ff.Name;
                }
            }

            axSftTree1.BulkUpdate = false;
            // make column widths optimal

C++

    fd.cySize.int64 = 10 * 10000L; // 10pt font
    fd.sWeight = FW_NORMAL;
    IFontDispPtr pFontDisp;
    HRESULT hr = OleCreateFontIndirect(&fd, IID_IFontDisp, (void**)&pFontDisp);
    if (FAILED(hr)) return;

    long ItemIndex = m_vTree->Items->Add(FontName);
     m_vTree->Item[ItemIndex]->Level = 1;
     m_vTree->Cell[ItemIndex][1]->Text = FontName;
     m_vTree->Cell[ItemIndex][0]->PutRefFont(pFontDisp);

}

/*static*/ int CALLBACK CListFontDlg::FontEnumeratorProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD FontType, LPARAM lParam)
{
    CListFontDlg* PTHIS = (CListFontDlg*) lParam;

See Also SftTree Object | Object Hierarchy


Last Updated 04/28/2018 - (email)
© 2018 Softel vdm, Inc.