The problem is this: after resizing the form and adding a pair of elements when the program starts, the form is displayed less than needed. The FormBorderStyle property FormBorderStyle set to FixedDialog . The window is displayed in the correct size if you set it to Sizable . After searching, I found that in ClientSize Designer.cs ClientSize property sets the size smaller, when I changed it to the desired one (371, 256) , the window became the correct size, but at the same time in the Size property, the values became larger (389, 303) and the designer became larger than necessary. What could be the problem?
|
1 answer
I noticed that Visual Studio suffers from a disease that sometimes randomly changes something in the Designer.cs file. The solution turned out to be the following: I opened the same file from the old version of the program and replaced the line with this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F) with this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F) , after which everything was in place.
|


Size- the size with a border,ClientSize- without a border. - Alexander Petrov