Winform使用WPF控件透明问题

h4819183 2013-05-29 12:07:12
设置了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的

...全文
217 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jaf932074323 2015-10-27
  • 打赏
  • 举报
回复
wpf中的控件还能放到WinFrom中?
we2677507 2015-09-14
  • 打赏
  • 举报
回复
同问啊,我也遇到同样的疑问
人生导师 2013-05-29
  • 打赏
  • 举报
回复
WPF和WinFrom渲染机制是不一样的,所以WPF代码放在WinForm中不适用是正常的,WinForm透明可以设置透明度属性来达到的,
h4819183 2013-05-29
  • 打赏
  • 举报
回复
大神 直接告诉我答案吧 WPF控件在WINForm窗体中 能否透明 如果可以 怎样才能透明 如果不可以 算了直接结贴吧
  • 打赏
  • 举报
回复
WPF和WINFORM是不一样的。你WPF的属性在winform里就不一定好使啊

110,565

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧