Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalency to TransparencyKey in WPF

Tags:

c#

wpf

In Win Form, we can create non-rectangular forms by creating a bitmap that have a background color like blue. So, we can set it to background image of Win Form and with change TransparencyKey option to blue, we have a shaped-window.

So, my question is What is the equivalency to TransparencyKey in WPF that does like Win Form's TransparencyKey?

Thanks for your attention :)

like image 642
Hossein Mobasher Avatar asked Nov 04 '22 15:11

Hossein Mobasher


1 Answers

There is no equivalent.
Just use an image with transparent areas (so it has to be a PNG or GIF), set the WindowStyle to None, set the window's background to Transparent, and set AllowTransparency to true.

Transparent areas will not be clickable.

like image 143
Thomas Levesque Avatar answered Nov 14 '22 21:11

Thomas Levesque