Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

CellEditIntercept Method, SftTree Object

Defines keystrokes to be intercepted during cell editing (using the EditNavigating event).

Syntax

VB.NETobject.CellEditIntercept(ByVal Key As Integer, ByVal Style As SftTreeCellEditInterceptStyleConstants)
VBobject.CellEditIntercept(ByVal Key As Long, ByVal Style As SftTreeCellEditInterceptStyleConstants)
C#.NETvoid object.CellEditIntercept(int Key, SftTreeCellEditInterceptStyleConstants Style);
VC++HRESULT object->CellEditIntercept(long Key, enum SftTreeCellEditInterceptStyleConstants Style);
CHRESULT object->raw_CellEditIntercept(long Key, enum SftTreeCellEditInterceptStyleConstants Style);

object

A SftTree object.

Key

A virtual key code. Defines the key to be intercepted during cell editing.

Symbol NameValueDescription
VK_LBUTTON0x01Touch screen
VK_CANCEL0x03Control-break processing
VK_BACK0x08BACKSPACE key
VK_TAB0x09TAB key
VK_CLEAR0x0cCLEAR key
VK_RETURN0x0dENTER key
VK_SHIFT0x10SHIFT key
VK_CONTROL0x11CTRL key
VK_MENU0x12ALT key
VK_CAPITAL0x14CAPS LOCK key
VK_ESCAPE0x1BESC key
VK_SPACE0x20SPACEBAR key
VK_PRIOR0x21PAGE UP key
VK_NEXT0x22PAGE DOWN key
VK_END0x23END key
VK_HOME0x24HOME key
VK_LEFT0x25LEFT ARROW key
VK_UP0x26UP ARROW key
VK_RIGHT0x27RIGHT ARROW key
VK_DOWN0x28DOWN ARROW key
VK_SELECT0x29SELECT key
VK_EXECUTE0x2BEXECUTE key
VK_SNAPSHOT0x2CPRINT SCREEN key for Windows 3.0 and later
VK_HELP0x2FHELP key
VK_00x300 key
VK_10x311 key
VK_20x322 key
VK_30x333 key
VK_40x344 key
VK_50x355 key
VK_60x366 key
VK_70x377 key
VK_80x388 key
VK_90x399 key
VK_A0x41A key
VK_B0x42B key
VK_C0x43C key
VK_D0x44D key
VK_E0x45E key
VK_F0x46F key
VK_G0x47G key
VK_H0x48H key
VK_I0x49I key
VK_J0x4AJ key
VK_K0x4BK key
VK_L0x4CL key
VK_M0x4DM key
VK_N0x4EN key
VK_O0x4FO key
VK_P0x50P key
VK_Q0x51Q key
VK_R0x52R key
VK_S0x53S key
VK_T0x54T key
VK_U0x55U key
VK_V0x56V key
VK_W0x57W key
VK_X0x58X key
VK_Y0x59Y key
VK_Z0x5AZ key
VK_NUMPAD00x60Numeric keypad 0 key
VK_NUMPAD10x61Numeric keypad 1 key
VK_NUMPAD20x62Numeric keypad 2 key
VK_NUMPAD30x63Numeric keypad 3 key
VK_NUMPAD40x64Numeric keypad 4 key
VK_NUMPAD50x65Numeric keypad 5 key
VK_NUMPAD60x66Numeric keypad 6 key
VK_NUMPAD70x67Numeric keypad 7 key
VK_NUMPAD80x68Numeric keypad 8 key
VK_NUMPAD90x69Numeric keypad 9 key
VK_MULTIPLY0x6AAsterisk (*) key
VK_ADD0x6BPlus sign (+) key
VK_SEPARATOR0x6CSeparator key
VK_SUBTRACT0x6DMinus sign (-) key
VK_DECIMAL0x6EPeriod (.) key
VK_DIVIDE0x6FSlash mark (/) key
VK_ATTN0xF6-
VK_CRSEL0xF7-
VK_EXSEL0xF8-
VK_EREOF0xF9-
VK_PLAY0xFA-
VK_ZOOM0xFB-
VK_NONAME0xFC-
VK_PA10xFD-
VK_OEM_CLEAR0xFE-
VK_LWIN0x5B-
VK_RWIN0x5C-
VK_APPS0x5D-
VK_LSHIFT0xA0-
VK_RSHIFT0xA1-
VK_LCONTROL0xA2-
VK_RCONTROL0xA3-
VK_LMENU0xA4-
VK_RMENU0xA5-

Note: Symbolic names are only available to applications written in C/C++, which use the #include directive to include WinUser.h, part of the Windows header files.

Style

Defines the processing options for the specified key. One or more values of the following table can be combined. Specify 0 to clear a key's processing options so it is no longer intercepted.

NameValueDescription
cellEditInterceptSftTreeChar1Character Only - If the key is pressed without the CONTROL or SHIFT key, the EditNavigating event occurs.
cellEditInterceptSftTreeControlChar4CONTROL + Character - If the key is pressed with the CONTROL key, the EditNavigating event occurs.
cellEditInterceptSftTreeShiftChar8SHIFT + Character - If the key is pressed with the SHIFT key, the EditNavigating event occurs.

Comments

The CellEditIntercept method defines keystrokes to be intercepted during cell editing (using the EditNavigating event).

A key that is intercepted will generate the EditNavigating event so the application can handle the key. Even keys such as RETURN and TAB, that are normally handled by enclosing forms, can be intercepted.

Only navigation keys should be intercepted. Other keys can be handled in the control's own event handlers (KeyDown/KeyPress/KeyUp events).

Any key that is intercepted will no longer generate KeyDown, KeyPress and KeyUp events for the control used for cell editing and must be completely handled by the EditNavigating event.

The CellEditIntercept method is normally used in the EditInitializing event to define cell navigation keys for the cell about to be edited.

The defined intercepted keys are cleared once cell editing for a cell ends (the EditEnding event occurs).

Examples

VB.NET

        End If

        ' Return the control's window handle
        e.window = ctrl.Handle.ToInt32()
        e.vData = ctrl

        ' Define navigation keys
        ' VK_TAB
        AxSftTree1.CellEditIntercept(9, SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeChar Or SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeControlChar Or SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeShiftChar)
        ' VK_RETURN
        AxSftTree1.CellEditIntercept(13, SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeChar Or SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeControlChar Or SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeShiftChar)
        ' VK_HOME
        AxSftTree1.CellEditIntercept(36, SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeControlChar)
        ' VK_END
        AxSftTree1.CellEditIntercept(35, SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeControlChar)

VB6

        Combo1.Text = SftTree1.Cell(EditIndex, EditCol).Text
    End If

    ' Return the control's window handle
    Window = ctrl.hwnd

    ' Define navigation keys
    ' VK_TAB
    SftTree1.CellEditIntercept Asc(vbTab), cellEditInterceptSftTreeChar + cellEditInterceptSftTreeControlChar + cellEditInterceptSftTreeShiftChar
    ' VK_RETURN
    SftTree1.CellEditIntercept Asc(vbCr), cellEditInterceptSftTreeChar + cellEditInterceptSftTreeControlChar + cellEditInterceptSftTreeShiftChar
    ' VK_HOME
    SftTree1.CellEditIntercept 36, cellEditInterceptSftTreeControlChar
    ' VK_END
    SftTree1.CellEditIntercept 35, cellEditInterceptSftTreeControlChar

C#

            }

            // Return the control's window handle
            e.window = (int) ctrl.Handle;
            e.vData = ctrl;

            // Define navigation keys
            // VK_TAB
            axSftTree1.CellEditIntercept(9, SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeChar | SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeControlChar | SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeShiftChar);
            // VK_RETURN
            axSftTree1.CellEditIntercept(13, SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeChar | SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeControlChar | SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeShiftChar);
            // VK_HOME
            axSftTree1.CellEditIntercept(36, SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeControlChar);
            // VK_END
            axSftTree1.CellEditIntercept(35, SftTreeCellEditInterceptStyleConstants.cellEditInterceptSftTreeControlChar);

C++

        m_Combo1.SetWindowText(str);
    }

    // Return the control's window handle
    *Window = (OLE_HANDLE) hwndControl;

    // Define navigation keys
    // VK_TAB
    m_vTree->CellEditIntercept(VK_TAB, (SftTreeCellEditInterceptStyleConstants) (cellEditInterceptSftTreeChar | cellEditInterceptSftTreeControlChar | cellEditInterceptSftTreeShiftChar));
    // VK_RETURN
    m_vTree->CellEditIntercept(VK_RETURN, (SftTreeCellEditInterceptStyleConstants) (cellEditInterceptSftTreeChar | cellEditInterceptSftTreeControlChar | cellEditInterceptSftTreeShiftChar));
    // VK_HOME
    m_vTree->CellEditIntercept(VK_HOME, cellEditInterceptSftTreeControlChar);
    // VK_END
    m_vTree->CellEditIntercept(VK_END, cellEditInterceptSftTreeControlChar);

See Also SftTree Object | Object Hierarchy


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


Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.