ACAT.Lib.Core.Utility.Windows.SetTrackBarValue C# (CSharp) Метод

SetTrackBarValue() публичный статический Метод

Sets value of a tackbar as an integer Takes care of cross-thread invokations that would result in .NET exceptions
public static SetTrackBarValue ( TrackBar trackBar, int positionValue ) : void
trackBar System.Windows.Forms.TrackBar
positionValue int
Результат void
        public static void SetTrackBarValue(TrackBar trackBar, int positionValue)
        {
            if (trackBar.InvokeRequired)
            {
                trackBar.Invoke(new setTrackBarValue(SetTrackBarValue), trackBar, positionValue);
            }
            else
            {
                if ((positionValue <= trackBar.Maximum) && (positionValue >= trackBar.Minimum))
                {
                    trackBar.Value = positionValue;
                }
                else
                {
                    Log.Debug("Trying to set trackbar outside legal bounds!");
                }
            }
        }