Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

EditValidate Event, SftTree Object

The new contents of the cell being edited are to be validated.

Syntax

VB.NETPrivate Sub object_EditValidate(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.EditValidate
VBPrivate Sub object_EditValidate(ByVal Window As OLE_HANDLE, ByVal vData As Variant, ByVal EditIndex As Long, ByVal EditCol As Integer, InputValid As Boolean)
C#.NETvoid object_EditValidate(object sender, EventArgumentType e);
VC++void OnEditValidateobject(OLE_HANDLE Window, const _variant_t& vData, long EditIndex, short EditCol, VARIANT_BOOL* InputValid);
CHRESULT OnEditValidateobject(OLE_HANDLE Window, VARIANT vData, long EditIndex, short EditCol, VARIANT_BOOL* InputValid);

object

A SftTree object.

Window

The window handle of the control being used for cell editing.

vData

Application-specific data provided as vData argument when Cell.Edit was called.

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.

InputValid

Return True if the contents are valid, False otherwise.

Comments

The EditValidate event occurs when the new contents of the cell being edited are to be validated.

The EditValidate event occurs when editing of one cell is about to end (the user clicks outside of the current cell being edited, cell navigation is handled or if the EndEdit(True) method is used. The EditValidate event allows the application to perform input validation. The new cell text currently contained in the control used for cell editing can be inspected and/or modified. If the text entered or selected is invalid, the InputValid variable can be set to False. This indicates that the new value cannot be accepted and cell editing is to be resumed. Setting InputValid to True (default), cell editing is ended.

If cell editing is aborted by the user by pressing the ESCAPE key, the EditValidate event is not generated.

The new cell contents can be saved while handling the EditEnding event.

The tree control properties cannot be modified during this event. If the tree control is updated in any way, cell editing is terminated. Use the EditEnding event to save the new cell contents.

Examples

VB.NET

        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
        Else
            S = Combo1.Text
        End If

VB6

    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
    Else
        S = Combo1.Text
    End If

C#

            }
        }

        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;
            else
                s = Combo1.Text;
            s = s.Trim();

C++

}

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)
        m_Edit1.GetWindowText(str);
    else
        m_Combo1.GetWindowText(str);

See Also SftTree Object | Object Hierarchy


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