HeaderPane
Main
Hide
Share Link
Print

EditInitializing Event, SftTree Object

The control used for cell editing is initialized.

Syntax

VB.NETPrivate Sub object_EditInitializing(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.EditInitializing
VBPrivate Sub object_EditInitializing(Window As OLE_HANDLE, vData As Variant, ByVal EditIndex As Long, ByVal EditCol As Integer, LeftPix As OLE_XPOS_PIXELS, TopPix As OLE_YPOS_PIXELS, WidthPix As OLE_XSIZE_PIXELS, HeightPix As OLE_YSIZE_PIXELS)
C#.NETvoid object_EditInitializing(object sender, EventArgumentType e);
VC++void OnEditInitializingobject(OLE_HANDLE* Window, VARIANT* vData, long EditIndex, short EditCol, OLE_XPOS_PIXELS* LeftPix, OLE_YPOS_PIXELS* TopPix, OLE_XSIZE_PIXELS* WidthPix, OLE_YSIZE_PIXELS* HeightPix);
CHRESULT OnEditInitializingobject(OLE_HANDLE* Window, VARIANT* vData, long EditIndex, short EditCol, OLE_XPOS_PIXELS* LeftPix, OLE_YPOS_PIXELS* TopPix, OLE_XSIZE_PIXELS* WidthPix, OLE_YSIZE_PIXELS* HeightPix);

object

A SftTree object.

Window

Returns the window handle of the control being used for cell editing. Initially, this argument contains the value passed as the Window argument of the Cell.Edit method.

vData

Returns application-specific data. Initially, this argument contains the application-specific data passed as the vData argument of the Cell.Edit method.

EditIndex

The zero-based index of the item being edited. The combination of EditIndex and EditCol describes an individual cell.

EditCol

The zero-based column number. The combination of EditIndex and EditCol describes an individual cell.

LeftPix

Returns the coordinate of the desired left edge of the control used for cell editing. Initially, this argument contains the left edge of the cell to be edited. Coordinates are in pixels and relative to the top, left edge of the control's client area.

TopPix

Returns the coordinate of the desired top edge of the control used for cell editing. Initially, this argument contains the top edge of the cell to be edited. Coordinates are in pixels and relative to the top, left edge of the control's client area.

WidthPix

Returns the desired width of the control used for cell editing. Initially, this argument contains width of the cell to be edited. Dimensions are in pixels.

HeightPix

Returns the desired height of the control used for cell editing. Initially, this argument contains the height of the cell to be edited. Dimensions are in pixels.

Comments

The EditInitializing event occurs when the control used for cell editing is initialized.

The initializing event is used to make a control for cell editing available, by returning a control window handle (Window). The control's display attributes and contents should be fully initialized by this event. Its dimensions and position should be returned in the LeftPix, TopPix, WidthPix, HeightPix arguments.

The control used for cell editing is positioned and sized using the LeftPix, TopPix, WidthPix and HeightPix values returned by the EditInitializing event. If the resulting rectangle is not completely visible vertically, it is moved so the control is completely visible within the tree control's client area. To position the control explicitly, use the EditInitialized event and set its Positioned argument to True.

The CellEditIntercept method can be used to define navigational keys and other keystrokes that should be intercepted while cell editing. The EditNavigating event occurs when keystrokes are intercepted.

Examples

VB.NET

    Private Sub AxSftTree1_EditAllowed(ByVal sender As Object, ByVal e As AxSftTreeLib80._DSftTreeEvents_EditAllowedEvent) Handles AxSftTree1.EditAllowed
        ' Last chance to suppress cell editing for a cell
        'If e.itemIndex = 1 And e.colIndex = 1 Then
        '    e.allowed = False
        'End If
    End Sub

    Private Sub AxSftTree1_EditInitializing(ByVal sender As Object, ByVal e As AxSftTreeLib80._DSftTreeEvents_EditInitializingEvent) Handles AxSftTree1.EditInitializing
        Dim ctrl As System.Windows.Forms.Control

        ' Choose a control based on current column being edited
        If e.editCol = 1 Then
            ctrl = Combo1
        Else
            ctrl = Text1
        End If

C++

}

BEGIN_EVENTSINK_MAP(CCellEditingDlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CCellEditingDlg)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 4 /* ItemClick */, OnItemClickSftTree1, VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I2)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 5 /* ItemDblClick */, OnItemDblClickSftTree1, VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I2)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 28 /* ToolTipVScroll */, OnToolTipVScrollSftTree1, VTS_PBSTR VTS_I4 VTS_I2)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 44 /* EditAllowed */, OnEditAllowedSftTree1, VTS_I4 VTS_I2 VTS_PBOOL)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 38 /* EditInitializing */, OnEditInitializingSftTree1, VTS_PI4 VTS_PVARIANT VTS_I4 VTS_I2 VTS_PI4 VTS_PI4 VTS_PI4 VTS_PI4)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 39 /* EditInitialized */, OnEditInitializedSftTree1, VTS_I4 VTS_VARIANT VTS_I4 VTS_I2 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_PBOOL)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 43 /* EditNavigating */, OnEditNavigatingSftTree1, VTS_I4 VTS_I2 VTS_I4 VTS_I2)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 37 /* EditValidate */, OnEditValidateSftTree1, VTS_I4 VTS_VARIANT VTS_I4 VTS_I2 VTS_PBOOL)
    ON_EVENT(CCellEditingDlg, IDC_SFTTREE1, 36 /* EditEnding */, OnEditEndingSftTree1, VTS_I4 VTS_VARIANT VTS_I4 VTS_I2 VTS_BOOL)
    //}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

See Also SftTree Object | Object Hierarchy


Last Updated 10/11/2026 - (email)
© 2026 Softel vdm, Inc.