Пример #1
0
 public CustomScrollBarAdapter(Orientation orientation, CustomScrollBarRenderer renderer)
 {
     switch(orientation)
     {
         case Orientation.Vertical:
             _scrollBar = new CustomVScrollbar() { Renderer = renderer };
             break;
         case Orientation.Horizontal:
             _scrollBar = new CustomHScrollbar() { Renderer = renderer };
             break;
         default:
             throw new ArgumentException("orientation");
     }
     _scrollBar.Scroll += OnScrollBarScroll;
     _scrollBar.ValueChanged += OnScrollBarValueChanged;
 }
Пример #2
0
 public CustomScrollBar()
 {
     SetStyle(
         ControlStyles.AllPaintingInWmPaint |
         ControlStyles.OptimizedDoubleBuffer |
         ControlStyles.Opaque |
         ControlStyles.ResizeRedraw |
         ControlStyles.Selectable |
         ControlStyles.UserPaint, true);
     SetStyle(
         ControlStyles.ContainerControl |
         ControlStyles.UseTextForAccessibility |
         ControlStyles.SupportsTransparentBackColor, false);
     TabStop      = false;
     _renderer    = CustomScrollBarRenderer.Default;
     _maximum     = 100;
     _smallChange = 1;
     _largeChange = 10;
     _timer       = new Timer();
     _timer.Tick += OnTimerTick;
 }
Пример #3
0
 public CustomScrollBar()
 {
     SetStyle(
         ControlStyles.AllPaintingInWmPaint |
         ControlStyles.OptimizedDoubleBuffer |
         ControlStyles.Opaque |
         ControlStyles.ResizeRedraw |
         ControlStyles.Selectable |
         ControlStyles.UserPaint, true);
     SetStyle(
         ControlStyles.ContainerControl |
         ControlStyles.UseTextForAccessibility |
         ControlStyles.SupportsTransparentBackColor, false);
     TabStop = false;
     _renderer = CustomScrollBarRenderer.Default;
     _maximum = 100;
     _smallChange = 1;
     _largeChange = 10;
     _timer = new Timer();
     _timer.Tick += OnTimerTick;
 }
Пример #4
0
        public CustomScrollBarAdapter(Orientation orientation, CustomScrollBarRenderer renderer)
        {
            switch (orientation)
            {
            case Orientation.Vertical:
                _scrollBar = new CustomVScrollbar()
                {
                    Renderer = renderer
                };
                break;

            case Orientation.Horizontal:
                _scrollBar = new CustomHScrollbar()
                {
                    Renderer = renderer
                };
                break;

            default:
                throw new ArgumentException("orientation");
            }
            _scrollBar.Scroll       += OnScrollBarScroll;
            _scrollBar.ValueChanged += OnScrollBarValueChanged;
        }