您的位置:首页 > 其它

如何设置窗口透明度

2011-06-08 11:33 411 查看
在MFC窗口中嵌入WPF控件时

Transparency settings. A top-level window can be configured to blend with the other windows on the desktop according to the per-pixel transparency of the WPF content.  To enable this, set the UsesPerPixelOpacity property in the HwndSourceParameters to true.  This can only be specified at construction time, and only through the HwndSource(HwndSourceParameters) constructor signature, and it imposes a number of limitations.

See :System.Windows.Interop.Hwndsource

 

独立的WPF窗口

<Window x:Class="Program.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525"
AllowsTransparency="False" Background="Transparent"
>
<Grid>
</Grid>
</Window>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: