InputPanel for WinForms | ComponentOne
C1.Win.InputPanel.8 Assembly / C1.Win.InputPanel Namespace / InputComponent Class / ErrorText Property
Example

In This Topic
    ErrorText Property (InputComponent)
    In This Topic
    Gets or sets an error description string with optional HTML tags.
    Syntax
    'Declaration
     
    Public Overridable Property ErrorText As String
    public virtual string ErrorText {get; set;}
    Remarks

    Setting this property to a non-empty string causes the component to be highlighted. The message is displayed as a tooltip when the user moves the mouse over the component.

    Setting this property to an empty string removes the higlight and restores the original tooltip text (ToolTipText).

    Example
    The example below uses the Validating event to set the error property on an InputNumericBox when the value entered is not an even number.
    private void inputNumericBox1_Validating(object sender, CancelEventArgs e)
    {
        if (inputNumericBox1.Value % 2 != 0)
        {
            inputNumericBox1.ErrorText = 
                "Please enter an <b>even</b> number!";
            e.Cancel = true;
        }
        else
        {
            inputNumericBox1.ErrorText = string.Empty;
        }
    }
    See Also