windows xp,vs2008,.net3.5sp1问题:在window+grid的方式下正常,但在page+grid的方式下需要鼠标在别处点一下才可显示MSCHART需要老鸟们指导一下,先多谢了!----------------.xaml<Page x:Class="TAEP_TAES.MonitorTrafficJamSpaceRealtime"
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="MonitorTrafficJamSpaceRealtime" Loaded="Page_Loaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.497*" />
<RowDefinition Height="0.503*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="142*" />
<ColumnDefinition Width="158*" />
</Grid.ColumnDefinitions>
<Grid>
<wfi:WindowsFormsHost x:Name="windowsFormsHost1" >
<CHR:Chart x:Name="mainChart" />
</wfi:WindowsFormsHost>
</Grid>
</Grid>
</Page>-----------------------------.cs public partial class MonitorTrafficJamSpaceRealtime : Page
{
public MonitorTrafficJamSpaceRealtime()
{
InitializeComponent();
} DataTable dt = new DataTable();
public static bool bFlag = true; private void Page_Loaded(object sender, RoutedEventArgs e)
{
if (bFlag)
{
DispatcherTimer dispatcherTimer = new DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
dispatcherTimer.Start(); //設定DataTable的欄位
SetDataTable();
//設定Chart Control
SetChart(); this.mainChart.DataSource = dt;
this.mainChart.DataBind();
bFlag = false;
}
}
解决方案 »
- 【100分】判断一点是否在不规则矩形内的算法(请大家多想几个)
- vs2005根据前台开始时间,结束时间参数将指定时间间隔内的数据绑定到水晶报表中
- 如何怎么把数据库中所有表放到一个DataSet里面?
- 请问各位专家,无法将类型"string"隐式转换为"bool",怎么办?
- 怎么样实现picturebox中的图片变化。
- 求助C#里面UsbLibrary类谁有没有实用案例之类的
- 特定电脑运行U盘中的EXE文件
- 各路GDI+兼双缓冲高手帮忙看看,这段代码运行太慢!如何改进?
- 我是新手,请问在C#中Find函数怎么用?
- 求助一问题的解法?
- C#如何查询某一目录中所有文件
- Convert.ToInt32的一个疑问
MSChart只在winform下用过