Visual Studio 2017中的WindowsFormsHost不绘制控件。

编程入门 行业动态 更新时间:2024-10-25 02:25:56
本文介绍了Visual Studio 2017中的WindowsFormsHost不绘制控件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在WPF窗口中放置一个ReportViewer。

但是当我使用WindowsFormsHost它没有绘制控件时,我用另一个控件测试它,但它不绘制任何控件。

这样:

< Window x:Class =" DocumentManager.Report.Report_Form" xmlns =" schemas.microsoft/winfx/2006/xaml/presentation" xmlns:x =" schemas.microsoft/winfx/2006/xaml" xmlns:d =" schemas.microsoft/expression/blend/2008" xmlns:mc =" schemas.openxmlformats/markup-compatibility/2006" xmlns:local =" clr-namespace:DocumentManager" xmlns:rv =" clr-namespace:Microsoft.Reporting.WinForms; assembly = Microsoft.ReportViewer.WinForms" mc:Ignorable =" d" Title ="Relatórios"高度= QUOT; 450"宽度= QUOT; 800" Style =" {DynamicResource CustomWindowStyle}" WindowStartupLocation = QUOT;中心屏幕"> < Window.Resources> < ResourceDictionary Source =" /Styles/Windows/StyleResources.xaml" /> < /Window.Resources> < Grid> < WindowsFormsHost Margin =" 5"名称= QUOT; windowsFormsHost1"> < rv:ReportViewer x:Name =" _reportViewer" /> < / WindowsFormsHost> < / Grid> < / Window>

解决方案

我发现了问题,为什么我不知道,如果我删除了样式的作品

I want to put a ReportViewer in a WPF Window.

But when I was using WindowsFormsHost it does not paint the control, I tested it with another control, but it does not paint any controls.

Stays like this:

<Window x:Class="DocumentManager.Report.Report_Form" xmlns="schemas.microsoft/winfx/2006/xaml/presentation" xmlns:x="schemas.microsoft/winfx/2006/xaml" xmlns:d="schemas.microsoft/expression/blend/2008" xmlns:mc="schemas.openxmlformats/markup-compatibility/2006" xmlns:local="clr-namespace:DocumentManager" xmlns:rv="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms" mc:Ignorable="d" Title="Relatórios" Height="450" Width="800" Style="{DynamicResource CustomWindowStyle}" WindowStartupLocation="CenterScreen"> <Window.Resources> <ResourceDictionary Source="/Styles/Windows/StyleResources.xaml"/> </Window.Resources> <Grid> <WindowsFormsHost Margin="5" Name="windowsFormsHost1"> <rv:ReportViewer x:Name="_reportViewer"/> </WindowsFormsHost> </Grid> </Window>

解决方案

I discovered the problem, the why I do not know, if I remove the style works.

更多推荐

Visual Studio 2017中的WindowsFormsHost不绘制控件。

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

发布评论

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

>www.elefans.com

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