SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Valid input is detected (custom application validation).
VB.NET | Private Sub object_CustomValidation(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.CustomValidation |
VB | Private Sub object_CustomValidation(Cancel As Boolean) |
C#.NET | void object_CustomValidation(object sender, EventArgumentType e); |
VC++ | void OnCustomValidationobject(VARIANT_BOOL* Cancel); |
C | HRESULT OnCustomValidationobject(VARIANT_BOOL* Cancel); |
object
Cancel
A Boolean value. If True is returned, the contents are considered invalid and the ValidationError event occurs. If False is returned, the contents are considered valid. The default is False.
The CustomValidation event occurs when valid input is detected (custom application validation).
The CustomValidation event occurs whenever the control loses the input focus or the Contents.ValidMsg and ValidMsg properties are used and the contents are valid (based on the Mask property).
This event allows the application to implement additional data validation, beyond the validation offered by the Mask property.
If the current input in the Masked Edit control is considered valid (based on the Mask property), the CustomValidation event occurs. The application can perform further validation and accept or reject the current contents.
Even though the contents are always considered valid in a simple edit control, the CustomValidation event still occurs.
axSftMaskAmount.Contents.Valid Then ' save the data Application.Exit() ' and exit Else MessageBox.Show("There are validation errors - Please correct the data entered.") End If End Sub Private Sub axSftMaskZIP_CustomValidation(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_CustomValidationEvent) Handles axSftMaskZIP.CustomValidation If axSftMaskZIP.Text <> "11111" Then e.cancel = True End If End Sub
SftMaskAmount.Contents.Valid Then ' save the data End ' and exit Else MsgBox ("There are validation errors - Please correct the data entered.") End If End Sub Private Sub SftMaskZIP_CustomValidation(Cancel As Boolean) 'To demonstrate custom validation, this sample application only accepts the ZIP Code 11111. If SftMaskZIP.Text <> "11111" Then Cancel = True End If End Sub
axSftMaskAmount.Contents.Valid) { // save the data Application.Exit(); // and exit } else { MessageBox.Show("There are validation errors - Please correct the data entered."); } } private void axSftMaskZIP_CustomValidation(object sender, AxSftMaskLib70._ISftMaskEvents_CustomValidationEvent e) { if (axSftMaskZIP.Text != "11111") { e.cancel = true; } }
m_vSftMaskTelephone = m_CtlTelephone.GetControlUnknown(); _ASSERT(m_vSftMaskTelephone != NULL); m_vSftMaskAmount = m_CtlAmount.GetControlUnknown(); _ASSERT(m_vSftMaskAmount != NULL); return TRUE; // return TRUE unless you set the focus to a control } void CSample4Dlg::OnCustomValidationSftMaskZip(BOOL FAR* Cancel) { if (m_vSftMaskZIP->Text != _bstr_t("11111")) { *Cancel = TRUE; } } void CSample4Dlg::OnOK()
See Also SftMask Events | Object Hierarchy