We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do the MinValue and MaxValue properties influence the behavior of the CurrencyTextBox?

 

The CurrencyTextBox takes the approach that considers two aspects of the contents of the text box to enforce the MinValue and MaxValue properties. The two aspects are: 1. The numerical value of the contents of the text box: This can be defined as the DecimalValue that the contents represent. For example, if the content of the CurrencyTextBox displays $1,234.34 and the MinValue is set to 1000.00 and the MaxValue is set to 2000.00, the NumericalValue of the CurrencyTextBox is 1234.34 and the text is considered valid based on the Minimum/Maximum considerations. 2. The length of the Numerical Part of the contents of the text box.

This can be defined easily through an example. If the content of the CurrencyTextBox displays $123.00 and the MinValue is set to 1000.00 and the MaxValue is set to 2000.00, the Numerical Part length of the CurrencyTextBox is 3 (considering only the 123 part of the CurrencyTextBox content). The Number Part Length of the MinValue is 4 (considering 1000) and the Number Part Value of the MaxValue is 4 (considering 2000). In this case, the NumericalValue comparison (aspect 1 explained above) is not applied when the user is inputting text. Shown below is the definition of when the above aspects are applied:

ActionAspects considered for MinValue and MaxValueCommentsUser inputs valueIn the following cases, only the length aspect is considered.

2.00 (allowed as length is less than 4)

22.00 (allowed as length is less than 4)

223.00 (allowed as length is less than 4)

In these cases, both the aspects are considered

2231.00 (not allowed as length equals 4 and value is greater than MaxValue)

1234.45 (allowed as length equals 4 and value is between Min and Max )

 

The example considers MinValue of 1000.00 and MaxValue of 2000.00User pastes into CurrencyTextBoxThe length aspect is not considered.

999.00 (not allowed as value is lesser than MinValue)

1999.00 (allowed as value is is between Min and Max)

The example considers MinValue of 1000.00 and MaxValue of 2000.00Text property is set through codeThe length aspect is not considered.

999.00 (not allowed as value is lesser than MinValue)

1999.00 (allowed as value is is between Min and Max)

 

The example considers MinValue of 1000.00 and MaxValue of 2000.00NOTE: When the value is not allowed in the above cases, a ValidationError event is raised. Also, during the Validating event, the ValidationError event is raised when the contents of the CurencyTextBox does not meet the MinValue and MaxValue conditions.

Article ID: Published Date: Last Revised Date: Platform: Control:
1103 04/30/2011 07/10/2014 WinForms CurrencyTextBox
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon