I belive that the 16-bit position limit is a function of the Windows OS
itself. You should see the same results with a C++/MFC program as well
as .NET.
You probably know that the Location property of Control is a Point
structure. The X and Y properties of Point are int's (Int32), of which
MSDN says:
"The Int32 value type represents signed integers with values ranging
from negative 2,147,483,648 through positive 2,147,483,647"
So, if you are using a Point structure outside of a Control, you should
be able to set it to any values within the range of Int32. You can
even set the values of a Control's location to something larger than
32767, but it gets fixed to 32767 after window layout and validation
occurs.
// If you run this code in a console app, you will get 1000000000 as
the outputs:
Control ctrl = new Control("Test", 1000000000, 1000000000, 100, 100);
Point pt = new Point(1000000000, 1000000000);
Console.WriteLine(pt.X.ToString());
Console.WriteLine(ctrl.Location.X.ToString());
// However, if you create a Windows Forms app with a PictureBox on the
form, and run this code in the forms constructor:
pictureBox1.Location = new Point(1000000000, 1000000000);
Console.WriteLine(pictureBox1.Location.ToString());
// This is output: {X=32767,Y=32767}
Unfortunately, I haven't found documentation of the 16-bit limit on
positions and sizes in Windows. Maybe someone else on the group may
have a link.
What are you trying to do?
-- Tim Scott
http://geekswithblogs.net/tscott