Hosting Windows Forms UserControl into Silverlight application

跟風遠走 提交于 2019-11-28 11:15:53

问题


I've a DLL written in Windows Forms. I need to host one UserControl from this DLL to my silverlight project. Is this possible?

In WPF, this is possible using WindowsFormsHost :

<WindowsFormsHost Name="m_WindowsFormsHost" Height="800" Width="900" >
            <winform:PlayerWindowControl />
</WindowsFormsHost>

I want to do this in silverlight.


回答1:


There is no similar support, nor does it seem likely any would be added, as Silverlight tries to be cross-platform. If you want this feature, then you should also have no problems being tied to Windows by using WPF, right?




回答2:


You can't use DLLs, not written for Silverlight.
Take a look to this post.



来源:https://stackoverflow.com/questions/4526172/hosting-windows-forms-usercontrol-into-silverlight-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!