I have defined a form having a GroupBox that contains some Buttons. I have then defined a second mode called "developer mode" that can be entered for certain purpose. For this mode I want to move and change the size of one of the buttons to make space for an other control element (that is only available in this developer mode).
The task seemed to be easy. Simply do this:
Button1.Location = new Point(x1, y1);
Button1.Size = new Size(x2, y2);
The outcomes was, that the buttons got located somewhere totally unpredictable and resized in a different why as expected.
So I tried to find out what the problem is. What I found out is that when I write out the credentials of that button after it got loaded into the form (and before I changed any parameter) it says something different than I have defined inside the properties of Button1. It appears as I defined it in the designer, but its size and location do have different value. E.g.
I defined the Size as 125,35.
The output "Button1.Size.Width" than says 94 and 28 for "Button1.Size.Height".
I define the Location as 495, 280.
The output "Button1.Locaction.X" than says 371 and 228 for "Button1.Location.Y"
Ahm,... so what just happened? Is there any resizing/relocation due to... I don't know... screentype one has? And what ever there is, how can I get control it?
Thanks for any input! Cheers