Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

EditNavigating Event, SftTree Object

A key has been intercepted which is used for navigation during cell editing.

Syntax

VB.NETPrivate Sub object_EditNavigating(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.EditNavigating
VBPrivate Sub object_EditNavigating(ByVal Key As Long, ByVal Shift As Integer, ByVal ItemIndex As Long, ByVal ColIndex As Integer)
C#.NETvoid object_EditNavigating(object sender, EventArgumentType e);
VC++void OnEditNavigatingobject(long Key, short Shift, long ItemIndex, short ColIndex);
CHRESULT OnEditNavigatingobject(long Key, short Shift, long ItemIndex, short ColIndex);

object

A SftTree object.

Key

A virtual key code. Defines the key that was intercepted. See the CellEditIntercept method for a list of available virtual key codes.

Shift

The state of the SHIFT, CONTROL and ALT keys during the event (see SftTreeKeyConstants). A bit is set if the key is down. The Shift argument is a bit field with bits corresponding to the SHIFT, CONTROL and ALT keys. The Shift variable indicates the state of these keys. Some, all, or none of the bits can be set, indicating which of the keys are pressed.

ShiftValueDescription
constSftTreeShiftMask1The SHIFT key was pressed.
constSftTreeCtrlMask2The CONTROL key was pressed.
constSftTreeAltMask4Not used. The ALT key was pressed.

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.

Comments

The EditNavigating event occurs when a key has been intercepted which is used for navigation during cell editing.

The CellEditIntercept method defines keystrokes to be intercepted during cell editing using the EditNavigating event. Only navigation keys should be intercepted. Other keys can be handled in the control's own event handlers (KeyDown/KeyPress/KeyUp events).

An application can handle a key by calling EndEdit to end cell editing of the current cell, followed by a call to Cell.Edit for the new cell to be edited.

Examples

VB.NET

            Combo1.Height = e.heightPix
            Combo1.Enabled = True
            Combo1.Visible = True
            Combo1.Focus()
            Combo1.DroppedDown = True
        End If
    End Sub

    Private Sub AxSftTree1_EditNavigating(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_EditNavigatingEvent) Handles AxSftTree1.EditNavigating
        ' Process key pressed
        AxSftTree1.EditNavigate(e.key, e.shift)
    End Sub

    Private Sub AxSftTree1_EditValidate(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_EditValidateEvent) Handles AxSftTree1.EditValidate
        ' Validate the new cell contents
        Dim S As String

VB6

        ' Combo1.Height = HeightPix * Screen.TwipsPerPixelY ' can't set height of a combo box
        Combo1.Enabled = True
        Combo1.Visible = True
        Combo1.SetFocus
        SendMessage Window, CB_SHOWDROPDOWN, 1, 0
    End If
End Sub

Private Sub SftTree1_EditNavigating(ByVal Key As Long, ByVal Shift As Integer, ByVal ItemIndex As Long, ByVal ColIndex As Integer)
    ' Process key pressed
    SftTree1.EditNavigate Key, Shift
End Sub

Private Sub SftTree1_EditValidate(ByVal Window As stdole.OLE_HANDLE, ByVal vData As Variant, ByVal EditIndex As Long, ByVal EditCol As Integer, InputValid As Boolean)
    ' Validate the new cell contents
    Dim S As String

C#

                Combo1.Height = e.heightPix;
                Combo1.Enabled = true;
                Combo1.Visible = true;
                Combo1.Focus();
                Combo1.DroppedDown = true;
            }
        }

        private void axSftTree1_EditNavigating(object sender, AxSftTreeLib75._DSftTreeEvents_EditNavigatingEvent e) {
            // Process key pressed
            axSftTree1.EditNavigate(e.key, e.shift);
        }

        private void axSftTree1_EditValidate(object sender, AxSftTreeLib75._DSftTreeEvents_EditValidateEvent e) {
            // Validate the new cell contents
            string s;

C++

        m_Combo1.MoveWindow(LeftPix, TopPix, WidthPix, HeightPix, TRUE);
        m_Combo1.EnableWindow();
        m_Combo1.ShowWindow(SW_NORMAL);
        m_Combo1.SetFocus();
        m_Combo1.ShowDropDown();
    }
}

void CCellEditingDlg::OnEditNavigatingSftTree1(long Key, short Shift, long ItemIndex, short ColIndex)
{
    // Process key pressed
    m_vTree->EditNavigate(Key, Shift);
}

void CCellEditingDlg::OnEditValidateSftTree1(long Window, const VARIANT FAR& vData, long EditIndex, short EditCol, BOOL FAR* InputValid)
{

See Also SftTree Object | Object Hierarchy


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