创建WPF应用程序!

编程入门 行业动态 更新时间:2024-10-23 15:33:12
本文介绍了创建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应用程序!

本文发布于:2023-06-01 10:24:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/412960.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   WPF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!