设置了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/up-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的WPFWinForm

解决方案 »

  1.   

    WPF和WinFrom渲染机制是不一样的,所以WPF代码放在WinForm中不适用是正常的,WinForm透明可以设置透明度属性来达到的,
      

  2.   

    WPF和WINFORM是不一样的。你WPF的属性在winform里就不一定好使啊
      

  3.   

    大神 直接告诉我答案吧  WPF控件在WINForm窗体中 能否透明如果可以 怎样才能透明如果不可以 算了直接结贴吧