On Windows 10 Some FormBorderStyles has no borders

2019-09-11 10:53发布

问题:

This is only an issue if you have Drop Shadows turned off in appearance settings.

I noticed some of our applications form windows had no borders. Specifically they have been missing the 1 pixel thick border for the left part, right part and bottom part of the form window. All of the forms had in common that they were using FormBorderStyle FixedToolWindow or SizableToolWindow. When it is like this it is hard to distinguish where one dialog stop and another one begins.

We find it plausible that some of our users will have their computers set up like this without the ability to change it.

Is there a way to get the dialog windows looking better without doing anything crazy like manually drawing all borders?

回答1:

Quoting part of a comment by Hans Passant:

By design for Win10, the left/bottom/right borders are transparent. Still quite visible against the large drop-shadow, so visible that is hard to tell that the border is transparent...

Our application has its own grahpical style that made it especially hard to distinguish where one dialog stops and the other one begins.

The quick solution for us was to stop using FormBorderStyle FixedToolWindow or SizableToolWindow.

Long term we are going trough all our dialogs and the graphical style of our application to make the dialogs more easily distinguishable from each other with or without borders.