Hi all, I'm creating a simple user control that has two properties that
represent a range of valid integer values.
For example:
int minimum, maximum;
public int Minimum
{
get { return mimimum; }
set { minimum = value; }
}
public int Maximum
{
get { return maximum; }
set { maximum= value; }
}
// P.S. I've deliberately made this simple to avoid cluttering code.
Using the properties window, I would like the programmer to be able to set
the minimum and maximum values to a proper
range - for example Minimum = 400 and Maximum = 800.
The rules are that the minimum value must be <= to the maximum value and the
maximum value must be >= to the minimum
value (a circular dependance on each other). Thus, setting the properties to
Minimum = 800 and Maximum = 400 would be illegal and the code would prevent
this.
Does anyone know of a way of doing this using two separate properties or can
it be done with one property or some other method I may have overlooked? Any
ideas would be appreciated.
Regards,
Paul