Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_timer != null)
                {
                    _timer.Stop();
                    _timer.Tick -= OnTimerTick;
                    _timer.Dispose();
                    _timer = null;
                }

                if (_trackBar != null)
                {
                    _trackBar.Dispose();
                    _trackBar = null;
                }

                if (_style != null)
                {
                    _style.Dispose();
                    _style = null;
                }

                if (_visualStyle != null)
                {
                    _visualStyle.PropertyChanged -= VisualStyle_PropertyChanged;
                    _visualStyle = null;
                }
            }
            base.Dispose(disposing);
        }
Ejemplo n.º 2
0
		public TrackSlider() : base()
		{
			base.SetStyle(ControlStyles.UserPaint, true);
			base.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
			base.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
			base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

			base.BackColor = Color.Transparent;
			base.DoubleBuffered = true;

			_visualStyle = new StandardTrackSliderVisualStyle();
			_visualStyle.PropertyChanged += VisualStyle_PropertyChanged;
			_style = _visualStyle.CreateReference();
			_trackBar = new TrackBar(this);

			if (!base.DesignMode)
			{
				_timer = new Timer();
				_timer.Interval = 10;
				_timer.Tick += OnTimerTick;
				_timer.Start();
			}
		}
Ejemplo n.º 3
0
        public TrackSlider() : base()
        {
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            base.BackColor      = Color.Transparent;
            base.DoubleBuffered = true;

            _visualStyle = new StandardTrackSliderVisualStyle();
            _visualStyle.PropertyChanged += VisualStyle_PropertyChanged;
            _style    = _visualStyle.CreateReference();
            _trackBar = new TrackBar(this);

            if (!base.DesignMode)
            {
                _timer          = new Timer();
                _timer.Interval = 10;
                _timer.Tick    += OnTimerTick;
                _timer.Start();
            }
        }
Ejemplo n.º 4
0
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (_timer != null)
				{
					_timer.Stop();
					_timer.Tick -= OnTimerTick;
					_timer.Dispose();
					_timer = null;
				}

				if (_trackBar != null)
				{
					_trackBar.Dispose();
					_trackBar = null;
				}

				if (_style != null)
				{
					_style.Dispose();
					_style = null;
				}

				if (_visualStyle != null)
				{
					_visualStyle.PropertyChanged -= VisualStyle_PropertyChanged;
					_visualStyle = null;
				}
			}
			base.Dispose(disposing);
		}
Ejemplo n.º 5
0
		private void ResetVisualStyle()
		{
			this.VisualStyle = new StandardTrackSliderVisualStyle();
		}
Ejemplo n.º 6
0
 private void ResetVisualStyle()
 {
     this.VisualStyle = new StandardTrackSliderVisualStyle();
 }