首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

有关问题,有关问题,又有有关问题 WPF 嵌入 WindowsFrom 控件有关问题

2012-01-05 
问题,问题,又有问题 WPF 嵌入 WindowsFrom 控件问题代码如下:System.Windows.Forms.Integration.WindowsFo

问题,问题,又有问题 WPF 嵌入 WindowsFrom 控件问题
代码如下:

System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
  //创建 WinForme 控件
  System.Windows.Forms.NotifyIcon notifyicon = new System.Windows.Forms.NotifyIcon();

  host.Child = notifyicon;
  LayoutRoot.Children.Add(host);

这样会有个错误,不能编译,不知道各位有没有什么好方法?

错误如下:

错误2无法将类型“System.Windows.Forms.NotifyIcon”隐式转换为“System.Windows.Forms.Control”

谢谢

[解决办法]
强制转换,OK了就结帖吧
[解决办法]
那个是 Component, 加入 Container

热点排行