Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

EditNavigate Method, SftTree Object

Positions cell editing on another cell.

Syntax

VB.NETHandled = object.EditNavigate(ByVal Key As Integer, ByVal Shift As Short) As Boolean
VBHandled = object.EditNavigate(ByVal Key As Long, ByVal Shift As Integer) As Boolean
C#.NETbool Handled = object.EditNavigate(int Key, short Shift);
VC++VARIANT_BOOL Handled = object->EditNavigate(long Key, short Shift);
CHRESULT object->raw_EditNavigate(long Key, short Shift, VARIANT_BOOL* Handled);

object

A SftTree object.

Key

A virtual key code. The key to be handled.

Symbol NameValueDescription
VK_TAB0x09TAB key - This key is handled by the EditNavigate method. Editing of the current cell ends and the next or previous editable cell in the tree control is edited. The TAB key will position to the next cell, SHIFT + TAB to the previous cell. The CONTROL key is ignored.
VK_RETURN0x0dENTER key - This key is handled by the EditNavigate method. Editing of the current cell ends and the next editable cell in the tree control is edited. The CONTROL and SHIFT keys are ignored.
VK_ESCAPE0x1bESC key - This key is handled by the EditNavigate method. Cell editing is ended by calling EndEdit.
VK_END0x23END key - This key is handled by the EditNavigate method if the CONTROL key is pressed. Editing of the current cell ends and the last editable cell in the tree control is edited.
VK_HOME0x24HOME key - This key is handled by the EditNavigate method if the CONTROL key is pressed. Editing of the current cell ends and the first editable cell in the tree control is edited.
VK_UP0x26UP ARROW key - This key is handled by the EditNavigate method if the CONTROL and SHIFT keys are not pressed. Editing of the current cell ends and the cell in the same column of the preceding item is edited.
VK_DOWN0x28DOWN ARROW key - This key is handled by the EditNavigate method if the CONTROL and SHIFT keys are not pressed. Editing of the current cell ends and the cell in the same column of the next item is edited.

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.

Shift

The state of the SHIFT, CONTROL and ALT keys (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.

Handled

Returns True if the key Key was handled by the EditNavigate method, otherwise False is returned.

Comments

The EditNavigate method positions cell editing on another cell.

The EditNavigate method implements default cell navigation for the virtual key codes Key and is called to handle navigation keys pressed during cell editing. These keys can be defined using the CellEditIntercept method. A key that is intercepted will generate the EditNavigating event so the application can handle the key by calling EditNavigate.

Examples

VB.NET

            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
        If e.vData Is Text1 Then
            S = Text1.Text

VB6

        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
    If Window = Text1.hwnd Then
        S = Text1.Text

C#

                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;
            if (e.vData == Text1)
                s = Text1.Text;

C++

        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)
{
    // Validate the new cell contents
    CString str;
    if ((HWND)Window == m_Edit1.m_hWnd)

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.