private void slideTimer_Tick(object sender, System.Timers.ElapsedEventArgs e) { if (bSlidingRight) { hscrollbar.Invoke((MethodInvoker) delegate() { hscrollbar.Value = Math.Min(hscrollbar.Value + 16, hscrollbar.Maximum - hscrollbar.LargeChange + 1); } ); } if (bSlidingLeft) { hscrollbar.Invoke((MethodInvoker) delegate() { hscrollbar.Value = Math.Max(hscrollbar.Value - 16, 0); } ); } if (bSlidingDown) { vscrollbar.Invoke((MethodInvoker) delegate() { vscrollbar.Value = Math.Min(vscrollbar.Value + 16, vscrollbar.Maximum - vscrollbar.LargeChange + 1); } ); } if (bSlidingUp) { vscrollbar.Invoke((MethodInvoker) delegate() { vscrollbar.Value = Math.Max(vscrollbar.Value - 16, 0); } ); } Invoke((MethodInvoker) delegate() { doDraggingToolMouseMove(PointToClient(Control.MousePosition).X, PointToClient(Control.MousePosition).Y); } ); }