In general, the problem is:

There is the following window:

window

The properties of the picture are as follows:

  • FormBorderStyle = FixedSingle
  • StartPosition = CenterScreen
  • ControlBox = false
  • HelpButton = false
  • MaximizeBox = false
  • MinimizeBox = false
  • TopMost = true
  • Any actions associated with the drawing / resizing of the form - no

At all, it is displayed correctly (as in the screenshot)
However, one person wrote the following to me:

PLEASE make custom windows screening buttons - it can’t be seen on the screen using the accelerator keys

I asked him to send a screenshot of the problem and saw the following:

problem

It clearly shows that for some reason the dimensions of the client area shrank a little, so that the button and the right side of the form left in an direction unknown to me

What happened, why so ... I have no idea ¯ \ _ (ツ) _ / ¯


So the question is:

  1. Why did this happen (is Windows 10 to blame, a large DPI or something else, and why)?
  2. How to fix it?

1 answer 1

The combination of the properties FormBorderStyle = FixedSingle and ControlBox = false with increased DPI is to blame. Apparently, this is a bug.

The solution is suggested here : leave the ControlBox equal to true in the form properties in the designer, and then set it to false already in the OnLoad method.

  • Thank you very much, you always help in the most incomprehensible situations) - Kir_Antipov