SftTree/OCX 7.5 Documentation

Display
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, const _variant_t&* 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 ItemIndex and ColIndex describes an individual cell.

EditCol

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

Left

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.

Top

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.

Width

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.

Height

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 Left, Top, Width, Height arguments.

The control's position cannot be set in the EditInitializing event, instead the EditInitialized event is used. Only the width and height of the control can be updated in the EditInitializing event (or also in the EditInitialized event).

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 AxSftTreeLib75._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 AxSftTreeLib75._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

VB6

Private Sub SftTree1_EditAllowed(ByVal ItemIndex As Long, ByVal ColIndex As Integer, Allowed As Boolean)
    ' Last chance to suppress cell editing for a cell
    'If ItemIndex = 1 And ColIndex = 1 Then
    '    Allowed = False
    'End If
End Sub

Private Sub SftTree1_EditInitializing(Window As stdole.OLE_HANDLE, vData As Variant, ByVal EditIndex As Long, ByVal EditCol As Integer, LeftPix As stdole.OLE_XPOS_PIXELS, TopPix As stdole.OLE_YPOS_PIXELS, WidthPix As stdole.OLE_XSIZE_PIXELS, HeightPix As stdole.OLE_YSIZE_PIXELS)
    Dim ctrl As Control

    ' Choose a control based on current column being edited
    If EditCol = 1 Then
        Set ctrl = Combo1
    Else
        Set ctrl = Text1
    End If

C#

        }

        private void axSftTree1_EditAllowed(object sender, AxSftTreeLib75._DSftTreeEvents_EditAllowedEvent e) {
            // Last chance to suppress cell editing for a cell
            //if (e.itemIndex == 1 && e.colIndex == 1)
            //    e.allowed = false;
        }

        private void axSftTree1_EditInitializing(object sender, AxSftTreeLib75._DSftTreeEvents_EditInitializingEvent e) {
            System.Windows.Forms.Control ctrl;

            // Choose a control based on current column being edited
            if (e.editCol == 1)
                ctrl = Combo1;
            else
                ctrl = Text1;

C++

void CCellEditingDlg::OnEditAllowedSftTree1(long ItemIndex, short ColIndex, BOOL FAR* Allowed)
{
    // Last chance to suppress cell editing for a cell
    //if (ItemIndex == 1 && ColIndex == 1)
    //    *Allowed = VARIANT_FALSE;
}

void CCellEditingDlg::OnEditInitializingSftTree1(long FAR* Window, VARIANT FAR* vData, long EditIndex, short EditCol, long FAR* LeftPix, long FAR* TopPix, long FAR* WidthPix, long FAR* HeightPix)
{
    HWND hwndControl;

    // Choose a control based on current column being edited
    if (EditCol == 1)
        hwndControl = m_Combo1.m_hWnd;
    else
        hwndControl = m_Edit1.m_hWnd;

See Also SftTree Object | Object Hierarchy


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