3

I have a piece of AutoHotKey script that allows me to set transparency on an active window but it does not work with WPF application like Powershell ISE.

Is there a way to do that?

EDIT: As is stated in the question I need to do that on a running WPF app like Powershell ISE.

Piotr Owsiak
  • 6,081
  • 8
  • 39
  • 42

2 Answers2

11

Set this in Window element

 AllowsTransparency="True" WindowStyle="None" Background="Transparent"
Maximus
  • 3,458
  • 3
  • 16
  • 27
1

Hi WPF is based on Direct3D, and is a bit different from win32 and forms which is based on GDI/GDI+.

In WPF you do this in your xaml(see example by maximus) or create your own window style.

There is a post here on how you should do this in WPF.

Another slightly related question.

A style :

<Style TargetType="Window" x:Key="TransparentWindowStyle">
    <Setter Property="WindowStyle" Value="None"/>         
    <Setter Property="AllowsTransparency=" Value="True"/>
    <Setter Property="Background" Value="Transparent"/>
</Style>

Skip the x:Key and it will be applied to all windows or you have to place in app.xaml or a place where it is shared, and apply it to the window. A bit overkill for just 3 properties, but handy if you are going to do other changes, that should be applied to multiple windows.

Hope it helps,

Stian

Community
  • 1
  • 1
Stígandr
  • 2,874
  • 21
  • 36