ComponentFactory.Krypton.Toolkit.ViewDrawTrackBar.SetRange C# (CSharp) Method

SetRange() public method

Sets the minimum and maximum values for a TrackBar.
public SetRange ( int minValue, int maxValue ) : void
minValue int The lower limit of the range of the track bar.
maxValue int The upper limit of the range of the track bar.
return void
        public void SetRange(int minValue, int maxValue)
        {
            if ((Minimum != minValue) || (Maximum != maxValue))
            {
                if (minValue > maxValue)
                    minValue = maxValue;

                _minimum = minValue;
                _maximum = maxValue;

                int beforeValue = _value;
                if (_value < _minimum)
                    _value = _minimum;

                if (_value > _maximum)
                    _value = _maximum;

                if (beforeValue != _value)
                    OnValueChanged(EventArgs.Empty);
            }
        }

Usage Example

Esempio n. 1
0
 /// <summary>
 /// Sets the minimum and maximum values for a TrackBar.
 /// </summary>
 /// <param name="minValue">The lower limit of the range of the track bar.</param>
 /// <param name="maxValue">The upper limit of the range of the track bar.</param>
 public void SetRange(int minValue, int maxValue)
 {
     if ((Minimum != minValue) || (Maximum != maxValue))
     {
         _drawTrackBar.SetRange(minValue, maxValue);
         PerformNeedPaint(true);
     }
 }