﻿ MaximumValue Property (PercentCellType) | Spread Windows Forms 13.0 Product Documentation
Spread Windows Forms 13.0 Product Documentation
Example

In This Topic
MaximumValue Property (PercentCellType)
In This Topic
Gets or sets the maximum value allowed for user entry.
Syntax
```'Declaration

Public Property MaximumValue As Double```
```'Usage

Dim instance As PercentCellType
Dim value As Double

instance.MaximumValue = value

value = instance.MaximumValue```
`public double MaximumValue {get; set;}`

#### Property Value

Double-precision, floating-point number representing the maximum value allowed in the cell
Exceptions
ExceptionDescription
Specified value exceeds the expected limit.
Remarks

The MinimumValue and MaximumValue properties limit the value that the user enters when editing the cell. It does not affect the data model and does not the limit the cell getting a value by other means, for example by means of a formula.

Use the MinimumValue and MaximumValue properties to place range restrictions on user entry. For example the following code limits user input to values between 0 and 100.

`	PercentCellType pct = new PercentCellType();	pct.MinimumValue = 0.0;	pct.MaximumValue = 100.0;	spread.Sheets[0].Cells[0,0].CellType = pct;`

Use the MIN and MAX functions to place range restrictions on formula calculations. For example, the following code limits the summation calculation to values between 0 and 100.

`	spread.Sheets[0].Cells[4,0].Formula = "MAX(0, MIN(SUM(A1:A4), 100))";`
Example
This example creates a percent-formatted numeric cell and sets the various formatting properties.
```FarPoint.Win.Spread.CellType.PercentCellType prctcell = new FarPoint.Win.Spread.CellType.PercentCellType();
prctcell.DecimalPlaces = 3;
prctcell.DecimalSeparator = ",";
prctcell.FixedPoint = true;
prctcell.MaximumValue = 50000.0;
prctcell.MinimumValue = -1000.0;
prctcell.NegativeRed = true;
prctcell.PercentSign = "%";
prctcell.Separator = "/";
prctcell.ShowSeparator = true;
prctcell.SpinButton = true;
prctcell.SpinDecimalIncrement = 10;
prctcell.SpinIntegerIncrement = 5;
prctcell.SpinWrap = true;
```Dim prctcell As New FarPoint.Win.Spread.CellType.PercentCellType()
prctcell.DecimalPlaces = 3
prctcell.DecimalSeparator = ","
prctcell.FixedPoint = True
prctcell.MaximumValue = 50000.0
prctcell.MinimumValue = -1000.0
prctcell.NegativeRed = True
prctcell.PercentSign = "%"