ComponentFactory.Krypton.Toolkit.ViewDrawScrollBar.SetScrollValues C# (CSharp) Method

SetScrollValues() public method

Update the scrollbar with the latest scrolling values.
public SetScrollValues ( int min, int max, int smallChange, int largeChange, int offset ) : void
min int Scroll minimum value.
max int Scroll maximum value.
smallChange int Size of a small change.
largeChange int Size of a large change.
offset int Current scrolling offset.
return void
        public void SetScrollValues(int min, 
                                    int max, 
                                    int smallChange,
                                    int largeChange,
                                    int offset)
        {
            // Update cached values (applying limit checking)
            _min = Math.Max(min, 0);
            _max = Math.Max(max, 0);
            _smallChange = Math.Max(smallChange, 0);
            _largeChange = Math.Max(largeChange, 0);
            _offset = Math.Max(offset, 0);

            if (_scrollBar != null)
            {
                // Set the scrolling values
                _scrollBar.Minimum = _min;
                _scrollBar.Maximum = _max;
                _scrollBar.SmallChange = _smallChange;
                _scrollBar.LargeChange = _largeChange;
                _scrollBar.Value = Math.Max(_min, Math.Min(_max, _offset));
            }
        }