I'm writing an application with a document style interface similar to MS Word. The problem is with the document viewer portion of the app. Basically it is a custom Panel control with each page in the document being represented as a separate child Panel. The child panels are laid out in a scrollable control the way you would expect a document to look.
Since documents can get very long, the pages that are scrolled out of view can have Location values that are very large. If each page is around 1200px in height, a 50 page document would be at least 60,000px tall. Even the pages that are out of view have to have their positions set correctly so that the scroll bars work properly.
The problem is that when I set any Location value higher than 32767 on my pages they quietly clamp to Int16.MaxValue, even though Point takes Int32 values. It is easy to recreate. It seems to apply to all controls:
private void button1_Click(object sender, EventArgs e) {
panel1.Location = new Point(40000, 40000);
Console.WriteLine(panel1.Location);
}
The output is : { X = 32767,Y = 32767 }
Can anyone think of a workaround for this? Any help would be greatly appreciated. I read the source for Control.cs and it doesn't appear to give me the answer.