Yes, how does it work. With the Aero Glass effect applied, everything painted in black will be displayed as transparent. This includes the text in the text box control. This common theme has been the subject of many other issues here. When they are well written, they collect a lot of votes, but few answers.
There are not many good solutions here. All of them that I encountered qualify as ugly and hacker. Own drawing is a reasonable approach when you use something like a shortcut control, but I would not recommend drawing your own text box - it is too difficult to get the right one. Someone tried to do it here ; as I said, the result is both ugly and hacky. I was not happy with this for my own use, but it may work for you, depending on how high your standards are.
The goal with owner drawing, of course, is to make the whole drawing using GDI + (which initially supports transparency) instead of GDI (which all built-in controls use by default) or calling functions like DrawThemeTextEx , which is specifically designed for rendering text with a shadow that is [somewhat] read over glass.
In addition, regular tricks, such as enabling compatible text rendering (which forces the built-in controls to draw using GDI + routines, as was the case in earlier versions of .NET), do not work for the text field.
Honestly, itβs best to place a text box over the region of your form that doesn't display like glass. Use the DwmEnableBlurBehindWindow function to selectively activate the glass effect over specific areas of your shape, and not the whole thing. I provide a complete, ready-to-use .NET implementation in my answer here .
Cody gray
source share