我有一段AutoHotKey脚本,可以让我在活动窗口上设置透明度,但它无法与WPF应用程序(如Powershell ISE)一起使用。是否有办法解决这个问题?编辑:如问题所述,我需要在运行的WPF应用程序(如Powershell ISE)上执行此操作。
将此设置在 Window 元素中
AllowsTransparency="True" WindowStyle="None" Background="Transparent"
你好,WPF基于Direct3D,与基于GDI/GDI+的win32和forms有些不同。
在WPF中,您可以在xaml中执行此操作(maximus提供了示例),或者创建自己的窗口样式。
一个样式:
<Style TargetType="Window" x:Key="TransparentWindowStyle">
<Setter Property="WindowStyle" Value="None"/>
<Setter Property="AllowsTransparency=" Value="True"/>
<Setter Property="Background" Value="Transparent"/>
</Style>