Question

Hi so I have just noticed something very strange and I'm wondering if anyone else has had this issue and how to fix it.

Basically using visual studios 2010 on a windows 7 computer I have noticed that the locations of my controls on a form are out of sync with the form size itself.

For example: If I make a form and set its size to 500x500 and then place a control on the form like a button and set its size to the same and its location to 0,0 then the control is cut off by about 10 pixels or so. It happens on both my work and home computer so it isn't the computer and the values are the same at both runtime and design time. It seems as though the controls are being scaled differently than the form and I am not sure why.

Any ideas?

Was it helpful?

Solution

The form's size includes the border. Use the ClientSize property instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top