/// <summary> /// Event handling for horizontal scroll bar. The image part will /// be adapted according to the position of horizontal scroll bar. /// </summary> private void hScrollBar1_Scroll(object sender, ScrollEventArgs e) { Rectangle rect = viewPort.ImagePart; rect.X = hScrollBar1.Value; hWndControl.setImagePart(rect.Y, rect.X, rect.Y + rect.Height, rect.X + rect.Width); hWndControl.repaint(); }