ComponentOne Input for WinForms
Using the C1Input Controls / Value and Text: Displaying, Validating, and Updating Values
In This Topic
    Value and Text: Displaying, Validating, and Updating Values
    In This Topic

    The Value property is the main property of a C1Input control and is responsible for returning and accepting a value with a specific DataType.

    When the control is not in EditMode, the Text shown by the control will display its current Value (except when TextDetached property is set to True) in a properly formatted form, see Formatting Data for details.

    If the control is not read-only, it automatically switches to EditMode when it receives input focus, provided that TextDetached property is set to False. Input focus refers to when the input window of the control receives focus. In edit mode, the control’s text is edited by the user while the Value remains unchanged until the editing ends. When the user attempts to leave the control, (for instance, move the input focus elsewhere), the Value property is updated with the Text entered by the user.

    The process of updating the Value involves the following three main actions:

    Setting the TextDetached property to True (it is False by default) forces the control into a special mode. If TextDetached property is set to True, the link between Value and Text is disabled, changing Value does not update Text, and changing Text does not update Value even when the control loses input focus. The Text property becomes independent of the Value property. This mode is useful when you want full programmatic control over updating the Text and Value.

    See Also