wpf System.Windows.Forms.Integration 命名空间在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/644789/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is the System.Windows.Forms.Integration namespace?
提问by Davy8
I can't seem to find it, trying to keyboard input in a wpf form spawned from a winforms form. Found this: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/442782b1-00a1-4e2e-9cc6-ae99b6699126/But when I try to use it, VS2008 complains about not being able to find the System.Windows.Forms.Integration namespace. I couldn't find a reference in the add references.
我似乎找不到它,试图以从 winforms 表单生成的 wpf 表单进行键盘输入。发现这个:http: //social.msdn.microsoft.com/Forums/en-US/wpf/thread/442782b1-00a1-4e2e-9cc6-ae99b6699126/但是当我尝试使用它时,VS2008 抱怨无法找到 System.Windows.Forms.Integration 命名空间。我在添加引用中找不到引用。
The only thing I can think of it maybe because it was a VS2005 project ported to VS2008?
我唯一能想到的可能是因为它是一个移植到 VS2008 的 VS2005 项目?
回答by JaredPar
You'll need to add a reference to WindowsFormsIntegration. If you do a Add Reference in Visual Studio, it will be near the last DLL available in the .Net tab
您需要添加对 WindowsFormsIntegration 的引用。如果您在 Visual Studio 中执行添加引用,它将靠近 .Net 选项卡中可用的最后一个 DLL
On my machine it's located at
在我的机器上它位于
%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\WindowsFormsIntegration.dll
%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\WindowsFormsIntegration.dll
回答by Ortund
Just came across the same problem.
刚刚遇到同样的问题。
While adding a reference to WindowsFormsIntegration.dll
didn't work as this has no WF controls in it, I did find that adding a reference to System.Windows.Forms
worked perfectly fine.
虽然添加对 的引用WindowsFormsIntegration.dll
不起作用,因为其中没有 WF 控件,但我确实发现添加对 的引用System.Windows.Forms
工作得非常好。
回答by timMulherin
Visual Studio filters the available namespaces according to the type of project you chose. If you need a namespace that is not listed, click the [Add...] button on the references tab of your project's properties. This will pop-up the Reference Manager window. Choose "Framework" from the list of Assemblies in the left-hand panel. This will display all the Microsoft provided namespaces. You will find WindowsFormsIntegration there.
Visual Studio 根据您选择的项目类型筛选可用的命名空间。如果需要未列出的命名空间,请单击项目属性的引用选项卡上的 [添加...] 按钮。这将弹出参考管理器窗口。从左侧面板的程序集列表中选择“框架”。这将显示所有 Microsoft 提供的命名空间。您会在那里找到 WindowsFormsIntegration。
回答by T.Todua
Use newer:
使用较新的:
%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\WindowsFormsIntegration.dll