Winform使用WPF控件透明有关问题
Winform使用WPF控件透明问题
设置了WPF控件颜色为透明色
winform窗体透明
把WPF在放到winform窗体中时 就出现了winform窗体颜色(黑色)
为什么呢 今天才接触WPF的
------解决思路----------------------
WPF和WinFrom渲染机制是不一样的,所以WPF代码放在WinForm中不适用是正常的,WinForm透明可以设置透明度属性来达到的,
------解决思路----------------------
WPF和WINFORM是不一样的。你WPF的属性在winform里就不一定好使啊
设置了WPF控件颜色为透明色
<UserControl x:Class="WpfControlLibrary1.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="267" d:DesignWidth="288"
Background="Transparent" >
<Grid Background="Transparent">
<ListView Name="listView1" Margin="12,12,41,30" Opacity="1" Background="Transparent">
</ListView>
</Grid>
</UserControl>
winform窗体透明
this.BackColor = Color.FromArgb(1,2,3);
this.TransparencyKey = this.BackColor;
把WPF在放到winform窗体中时 就出现了winform窗体颜色(黑色)
为什么呢 今天才接触WPF的
------解决思路----------------------
WPF和WinFrom渲染机制是不一样的,所以WPF代码放在WinForm中不适用是正常的,WinForm透明可以设置透明度属性来达到的,
------解决思路----------------------
WPF和WINFORM是不一样的。你WPF的属性在winform里就不一定好使啊