protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e) { IScrollBarItem pScrollBarItem = this.pOwner as IScrollBarItem; if (pScrollBarItem == null) { return; } switch (this.eScrollBarButtonStyle) { case ScrollBarButtonStyle.eMinusButton: case ScrollBarButtonStyle.ePlusButton: this.TimerStop(); break; default: break; } //base.OnMouseUp(e); }
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs mevent) { IScrollBarItem pScrollBarItem = this.pOwner as IScrollBarItem; if (pScrollBarItem == null) { return; } switch (this.eScrollBarButtonStyle) { case ScrollBarButtonStyle.eMinusButton: pScrollBarItem.Value -= pScrollBarItem.Step; this.TimerStart(); break; case ScrollBarButtonStyle.ePlusButton: pScrollBarItem.Value += pScrollBarItem.Step; this.TimerStart(); break; } //base.OnMouseDown(mevent); }
void Timer_Tick(object sender, EventArgs e) { if (this.m_Timer.Interval > 80) { this.m_Timer.Interval = 80; } // IScrollBarItem pScrollBarItem = this.pOwner as IScrollBarItem; if (pScrollBarItem == null) { return; } switch (this.eScrollBarButtonStyle) { case ScrollBarButtonStyle.eMinusButton: if (pScrollBarItem.Value > pScrollBarItem.Minimum) { pScrollBarItem.Value -= pScrollBarItem.Step; } else { this.TimerStop(); } break; case ScrollBarButtonStyle.ePlusButton: if (pScrollBarItem.Value < pScrollBarItem.Maximum) { pScrollBarItem.Value += pScrollBarItem.Step; } else { this.TimerStop(); } break; } }