protected void HorizontalScroll(int value)
{
int scrollVal = this.hScrollBar.Value - value;
if (scrollVal != 0)
{
RECT scrollRect = RECT.FromRectangle(this.PseudoClientRect);
Rectangle invalidateRect = scrollRect.ToRectangle();
NativeMethods.ScrollWindow(this.Handle, scrollVal, 0, ref scrollRect, ref scrollRect);
if (scrollVal < 0)
invalidateRect.X = invalidateRect.Right + scrollVal;
invalidateRect.Width = Math.Abs(scrollVal);
this.Invalidate(invalidateRect, false);
if (this.VScroll)
{
this.Invalidate(new Rectangle(this.Width - this.BorderWidth - SystemInformation.VerticalScrollBarWidth,
this.Height - this.BorderWidth - SystemInformation.HorizontalScrollBarHeight,
SystemInformation.VerticalScrollBarWidth,
SystemInformation.HorizontalScrollBarHeight),
false);
}
}
}