gpt4 book ai didi

wpf - 使用 WindowsformsHost 将报表查看器插入 WPF 应用程序时出现问题

转载 作者:可可西里 更新时间:2023-11-01 09:57:01 28 4
gpt4 key购买 nike

我正在尝试从我的 WPF 应用程序创建一个弹出窗口,它显示一个托管在 WindowsFormsHost 中的报表查看器但是我在使用以下 Xaml 时遇到问题

<Page x:Class="FIS3.ReportViewer.ReportViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
Title="MapViewer">
<Grid>
<my:WindowsFormsHost>

</my:WindowsFormsHost>
<Label Name="exampleText" Content="this is the Report Viewer ..." />
</Grid>

我收到构建错误通知我“未找到类型‘my:WindowsFormsHost’。确认您没有缺少程序集引用并且所有引用的程序集都已构建”

我在我的 XAML 中犯了错误吗我已将 WindowsFormsIntegration 添加为对我的项目的引用。

谢谢你的帮助

上校

最佳答案

人们似乎忽略了第二种解决方案。我在这个问题上挠了挠头足足有 20 分钟。包括这个在内的任何解决方案都行不通。结果我的解决方案是添加:

Windows 窗体集成

我的引用资料

在我意识到基于:

http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.windowsformshost.aspx

这使用 WindowsFormsIntegration.dll。我的引用文献中似乎遗漏了它。

希望这对您有所帮助!

关于wpf - 使用 WindowsformsHost 将报表查看器插入 WPF 应用程序时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2100660/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com