【发布时间】:2010-05-18 13:18:00
【问题描述】:
大家好
我有以下问题:
我想使用 Windows 窗体中的 Chart,因为它允许构建比 WPF Toolkit 中更多类型的图形可视化。
因此,我将 Windows 窗体的图表控件作为子元素添加到 WindowsFormsHost 中。但是,当我运行该应用程序时,我和我所有的客户只看到白色区域。不过,任何其他 Windows 窗体控件在 Windows 窗体主机中都能很好地工作。
图表控件有什么问题?
这是 XAML 代码
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:CHR="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
Title="Window1" Height="300" Width="300">
<Grid>
<wfi:WindowsFormsHost x:Name="mainFGrid" >
<CHR:Chart x:Name="mainChart" />
</wfi:WindowsFormsHost>
</Grid>
</Window>
亲切的问候,
Anatoliy Sova
【问题讨论】:
-
您认为这与 .Net Framework 3.5 sp1 有关吗?如果您找到任何解决方案,请告诉我!