Runtime error in wpf using Window.AllowsTransparent set to true

I get an exception raised at runtime when I install AllowsTransparency="True". I get an exception saying that WindowStyleit cannot be set to Noneif the parameter is AllowsTransparencyset to true. Even if I directly say that it is WindowStyleset to SingleBorder, I get this error. However, if I set WindowStylein SingleBorderand removed AllowsTransparency-tag, I do not get an error, and the top of the window (icon, name, and close, minimize and maximize buttons) disappear. Does anyone know what might cause this? Or is it just a bug in .Net 4.0 rc?

[Edit]
I also tried this in VS2008, and get the same results. What I have not achieved is a simple window in which I draw a window myself and leave nothing in the system, however things like minimization and maximization should work.

+3
source share
1 answer

The error must be the opposite, so you are either working with the error or you are not reading the error message correctly. Every time you have AllowsTransparency = "True", the only valid WindowStyle value is None. Any of the others adds window chrome, depending on the operating system, which cannot be forced to have transparency in its client area.

+3
source

Source: https://habr.com/ru/post/1739924/


All Articles