/// <summary> /// Performs scrollBar setup /// </summary> private void SetUpScrollBar() { _ScrollBar = new VScrollBarAdv(); _ScrollBar.Width = SystemInformation.VerticalScrollBarWidth; Control c = (Control)CalendarView.CalendarPanel.GetContainerControl(true); if (c != null) c.Controls.Add(_ScrollBar); _ScrollBar.ValueChanged += ValueChanged; UpdateScrollBar(); }
/// <summary> /// Initializes a new instance of the PageSlider class. /// </summary> public PageSlider() { _StepIndicator = new StepIndicator(); _StepIndicator.Dock = DockStyle.Top; this.Controls.Add(_StepIndicator); if (BarFunctions.IsWindows7 && Touch.TouchHandler.IsTouchEnabled) { _TouchHandler = new DevComponents.DotNetBar.Touch.TouchHandler(this); _TouchHandler.PanBegin += new EventHandler<DevComponents.DotNetBar.Touch.GestureEventArgs>(TouchHandlerPanBegin); _TouchHandler.Pan += new EventHandler<DevComponents.DotNetBar.Touch.GestureEventArgs>(TouchHandlerPan); _TouchHandler.PanEnd += new EventHandler<DevComponents.DotNetBar.Touch.GestureEventArgs>(TouchHandlerPanEnd); } _HorizontalScrollBar = new HScrollBarAdv(); _HorizontalScrollBar.Dock = DockStyle.Bottom; _HorizontalScrollBar.Height = 12; _HorizontalScrollBar.Scroll += new ScrollEventHandler(ScrollBarScroll); _HorizontalScrollBar.Visible = false; this.Controls.Add(_HorizontalScrollBar); _VerticalScrollBar = new VScrollBarAdv(); _VerticalScrollBar.Dock = DockStyle.Right; _VerticalScrollBar.Width = 12; _VerticalScrollBar.Scroll += new ScrollEventHandler(ScrollBarScroll); _VerticalScrollBar.Visible = false; this.Controls.Add(_VerticalScrollBar); }
/// <summary> /// Initializes a new instance of the ScrollbarControl class. /// </summary> public ScrollbarControl() { this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.ResizeRedraw | DisplayHelp.DoubleBufferFlag, true); _HScrollBar = new HScrollBarAdv(); _HScrollBar.Visible = false; _HScrollBar.Appearance = _ScrollBarAppearance; _HScrollBar.Scroll += HScrollBarScroll; _VScrollBar = new VScrollBarAdv(); _VScrollBar.Visible = false; _VScrollBar.Appearance = _ScrollBarAppearance; _VScrollBar.Scroll += VScrollBarScroll; this.Controls.Add(_HScrollBar); this.Controls.Add(_VScrollBar); _Thumb = new Control(); _Thumb.Visible = false; _Thumb.BackColor = SystemColors.Window; this.Controls.Add(_Thumb); }
/// <summary> /// Sets up TimeLine vertical scrollbar /// </summary> private void SetUpTvScrollBar() { _VScrollBar = new VScrollBarAdv(); _VScrollBar.Width = _CalendarView.VsWidth; Control c = (Control)this.GetContainerControl(true); if (c != null) c.Controls.Add(_VScrollBar); _VScrollBar.ValueChanged += VScrollBar_ValueChanged; }
private void SetupScrollBars() { _VScrollBar = new VScrollBarAdv(); _VScrollBar.Width = SystemInformation.VerticalScrollBarWidth; _VScrollBar.Scroll += VScrollBarScroll; _VScrollBar.MouseEnter += VScrollBarMouseEnter; _HScrollBar = new HScrollBarAdv(); _HScrollBar.Height = SystemInformation.HorizontalScrollBarHeight; _HScrollBar.Scroll += HScrollBarScroll; _HScrollBar.MouseEnter += HScrollBarMouseEnter; _HScrollBar.Visible = false; _VScrollBar.Visible = false; Controls.Add(_HScrollBar); Controls.Add(_VScrollBar); }
/// <summary> /// Resets the AllDayPanel view /// </summary> public void ResetView() { _VScrollPos = 0; if (_VScrollBar != null) { _VScrollBar.ValueChanged -= _VExtScrollBar_ValueChanged; _VScrollBar.Dispose(); _VScrollBar = null; } }
/// <summary> /// Updates our vertical scrollbar /// </summary> private void UpdateVScrollBar() { if (_PanelHeight > 0 && _PanelHeight < _MaximumPanelHeight) { // If we don't have one already, allocate it if (_VScrollBar == null) { _VScrollBar = new VScrollBarAdv(); _VScrollBar.Width = VsWidth; Control c = (Control)this.GetContainerControl(true); if (c != null) c.Controls.Add(_VScrollBar); _VScrollBar.ValueChanged += _VExtScrollBar_ValueChanged; } // Initialize the scrollbar _VScrollBar.Location = new Point(Bounds.Right + 1, Bounds.Y); _VScrollBar.Height = _PanelHeight; _VScrollBar.SmallChange = _PanelHeight / 2; _VScrollBar.LargeChange = _WeekDayView.AppointmentHeight * 2; _VScrollBar.Maximum = _MaximumPanelHeight - _VScrollBar.Height + _VScrollBar.LargeChange; if (_VScrollBar.Visible == false) { _VScrollPos = 0; _VScrollBar.Value = 0; _VScrollBar.Show(); _VScrollBar.BringToFront(); } else { if (_VScrollBar.Value > _VScrollBar.Maximum - _VScrollBar.LargeChange) _VScrollBar.Value = _VScrollBar.Maximum - _VScrollBar.LargeChange; } _VScrollBar.Refresh(); } else if (_VScrollBar != null) { _VScrollPos = 0; _VScrollBar.ValueChanged -= _VExtScrollBar_ValueChanged; _VScrollBar.Dispose(); _VScrollBar = null; } }