创建WPF应用程序! [英] Create WPF Application!

查看:147
本文介绍了创建WPF应用程序!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

谁能为初学者提供帮助?我想创建WPF应用程序.我有以下代码返回新的WindowInteropHelper(this).Handle;".但是系统无法编译此代码.我收到以下错误消息:

找不到类型或名称空间名称"WindowInteropHelper"(您是否缺少using指令或程序集引用?"

Hello,

Can anyone help for beginner? I want to create WPF Application. I have the following code "return new WindowInteropHelper(this).Handle;" but system couldn''t compile this code. I got following error message:

"The type or namespace name ''WindowInteropHelper'' could not be found (are you missing a using directive or an assembly reference?"

推荐答案

以下步骤可能对您有所帮助解决此问题.

1)在您的项目中添加对" PresentationFramework.dll "的引用.
2)在类中添加System.Windows.Interop命名空间的引用.
Below steps may help you to resolve this issue.

1) Add reference of "PresentationFramework.dll" in your Project.
2) Add reference of System.Windows.Interop Namespace in your Class.


假设您使用的是Visual Studio或Visual C#Express,则可以使用新的项目向导轻松地创建WPF项目.
Assuming you are using Visual Studio or Visual C# Express, you can easily create a WPF project with the new project wizard.


问题已解决,我添加了对System.Windows.Interop的引用.

我引用了System.Runtime.InteropServices,我认为与System.Runtime.Interop相同.

非常感谢.
The issue is fixed, I added reference of System.Windows.Interop.

I had reference System.Runtime.InteropServices and i thought it is the same with System.Runtime.Interop.

Thank you very much.


这篇关于创建WPF应用程序!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆