0

I want to create desktop border less widget with semi-transparent background in WF. Like this :

enter image description here

But with no luck for now. All can i achieve is full background transparency with

this.BackColor = Color.Black;
this.TransparencyKey = this.BackColor;

Or entire form with

this.Opacity = .4;

Some time I also spend on combination TransparencyKey with BackgroundImage, but result was just a solid black background.

Fully desperate I created two Forms one fully transparent with text and second with opacity, but i couldn't keep first window above during moving, so text was dimmed.

Is there any possibility to make this in WF or I need to look for QT or antoher window library.

Sajgoniarz
  • 176
  • 13
  • You can use Layered Windows. For example take a look at [Windows Form Transparent Background Image](http://stackoverflow.com/a/33531201/3110834) – Reza Aghaei Nov 13 '16 at 13:31
  • You'd normally need a sandwich of two windows. The bottom one using Opacity and the top one using TransparencyKey. But it is a pretty bad idea in general to display text on an unpredictable background. The standard anti-aliasing effects don't work properly anymore and don't blend the letter shape into the background anymore. They become pretty visible and the text looks ugly. Only correct way to do it is to create a screenshot with Graphics.CopyFromScreen(), alter that bitmap with a brush that has an alpha < 255 and then draw the text on top of it. Works fine for a splashscreen. – Hans Passant Nov 13 '16 at 15:38
  • Hans i made sandwich, and font looks ok, but when background is transparent you are able to click through window and select underlying one, which in my case bring background layer to top, nad dim text. – Sajgoniarz Nov 13 '16 at 16:20

1 Answers1

0

After few days of research I didn't find any solution working at Windows 10. It looks like there is no method that will work on it. So I ended with creating this project in WPF, where it can be made easily.

Sajgoniarz
  • 176
  • 13