SftTree/OCX 7.5 - ActiveX Tree Control


Edit Method, SftTreeCell Object

Edits the cell.


VB.NETobject.Edit(ByVal Window As Integer, ByVal vData As Object)
VBobject.Edit(ByVal Window As OLE_HANDLE, ByVal vData As Variant)
C#.NETvoid object.Edit(int Window, object vData);
VC++HRESULT object->Edit(OLE_HANDLE Window, const _variant_t& vData);
CHRESULT object->raw_Edit(OLE_HANDLE Window, VARIANT vData);


A SftTreeCell object.


A window handle. Defines the control used for cell editing. This parameter can be Nothing (NULL) to allow the EditInitializing event to provide the window handle used for cell editing (which is also the preferred method).


An application-specific value. This value is used as vData parameter for the EditInitializing event. This parameter can be Nothing (NULL).


The Edit method edits the cell.

Cell editing is initiated by the subsequent EditInitializing event which is used to position and initialize the control used for cell editing.

The Edit method cannot edit a cell whose Cell.EditIgnore or Item.EditIgnore properties have marked the cell as non-editable or if the EditAllowed event indicates that the cell cannot be reached during cell editing.



    End Sub

    Private Sub AxSftTree1_ItemClick(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_ItemClickEvent) Handles AxSftTree1.ItemClick
        Dim Img As SftPictureObject
        Dim AreaType As SftTreeAreaTypeConstants
        AreaType = e.areaType
        If AreaType = SftTreeAreaTypeConstants.constSftTreeCellText Then
            ' User clicked on a cell
           AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Edit(0, 0)
        ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeCellGraphic Then
           ' check if check box - toggle
           Img = AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Image
           If Img.Appearance = SftPictureImageConstants.sftImageCheckboxNo Then
               Img.Appearance = SftPictureImageConstants.sftImageCheckboxYes
           ElseIf Img.Appearance = SftPictureImageConstants.sftImageCheckboxYes Then
               Img.Appearance = SftPictureImageConstants.sftImageCheckboxNo



End Sub

Private Sub SftTree1_ItemClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer)
    If AreaType = constSftTreeCellText Then
        ' User clicked on a cell
        SftTree1.Cell(ItemIndex, ColIndex).Edit 0, 0
    ElseIf AreaType = constSftTreeCellGraphic Then
        ' check if check box - toggle
        Dim Img As SftPictureObject
        Set Img = SftTree1.Cell(ItemIndex, ColIndex).Image
        If Img.Appearance = sftImageCheckboxNo Then
            Img.Appearance = sftImageCheckboxYes
        ElseIf Img.Appearance = sftImageCheckboxYes Then



        private void axSftTree1_ItemClick(object sender, AxSftTreeLib75._DSftTreeEvents_ItemClickEvent e) {
            SftPictureObject Img;
            SftTreeAreaTypeConstants area = (SftTreeAreaTypeConstants) e.areaType;
            if (area == SftTreeAreaTypeConstants.constSftTreeCellText)
                // User clicked on a cell
                axSftTree1.get_Cell(e.itemIndex, e.colIndex).Edit(0, 0);
            else if (area == SftTreeAreaTypeConstants.constSftTreeCellGraphic) {
                // check if check box - toggle
                Img = axSftTree1.get_Cell(e.itemIndex, e.colIndex).Image;
                if (Img.Appearance == SftPictureImageConstants.sftImageCheckboxNo)
                    Img.Appearance = SftPictureImageConstants.sftImageCheckboxYes;
                else if (Img.Appearance == SftPictureImageConstants.sftImageCheckboxYes)
                    Img.Appearance = SftPictureImageConstants.sftImageCheckboxNo;


HCURSOR CCellEditingDlg::OnQueryDragIcon()
    return (HCURSOR) m_hIcon;

void CCellEditingDlg::OnItemClickSftTree1(long ItemIndex, short ColIndex, short AreaType, short Button, short Shift)
    if (AreaType == constSftTreeCellText) {
        m_vTree->Cell[ItemIndex][ColIndex]->Edit(NULL, _variant_t(0L));
    } else if (AreaType == constSftTreeCellGraphic) {
        // check if check box - toggle
        ISftPictureObjectPtr pImg;
        pImg = m_vTree->Cell[ItemIndex][ColIndex]->Image;
        if (pImg->Appearance == sftImageCheckboxNo)
            pImg->Appearance = sftImageCheckboxYes;
        else if (pImg->Appearance == sftImageCheckboxYes)

See Also SftTreeCell Object | Object Hierarchy

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