关于System.Timers.Timer控制主线程控件的问题 线程中不要直接控制UI控件,你可以把数据算好,然后通过委托去通知UI更新 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public delegate DoProcess(Chart inputchart,int chartindex,int pointIndex); private void RefreshUI(Chart inputchart,int chartindex,int pointIndex) { if (this.InvokeRequired) { this.Invoke(new DoProcess(RefreshMainform), new object[]{inputchart,chartindex,pointIndex}); } else { inputchart.ChartAreas["Default"+chartindex].AxisX.Maximum = pointIndex; } } public void threadDo() { if (chart1.ChartAreas["Default1"].AxisX.Maximum < pointIndex) { RefreshUI(chart1, 1, pointIndex); } if (chart2.ChartAreas["Default2"].AxisX.Maximum < pointIndex) { RefreshUI(chart2, 2, pointIndex); } if (chart3.ChartAreas["Default3"].AxisX.Maximum < pointIndex) { RefreshUI(chart3, 3, pointIndex); } } 求一个C#名户字正则表达式,谢谢! C# 修改文件的摘要 未处理的“System.StackOverflowException”类型的异常出现在 system.windows.forms.dll 中。 同一解决方案的几个项目之间为什么不能互相引用呢? 简单问题:请问如何得到网络上文件的大小 父类如何捕获子类的事件 C#中关于自定义控件变为容器的问题? Web程序 混淆加密后居然都不能用,请大家帮忙 DLL 地狱 又100分,在线等待:在C#中自己定义了一个类publicFun.cs,问题如下: 多个DataGridView绑定多个表时出现错误 vs单元测试问题
public delegate DoProcess(Chart inputchart,int chartindex,int pointIndex);
private void RefreshUI(Chart inputchart,int chartindex,int pointIndex)
{
if (this.InvokeRequired)
{
this.Invoke(new DoProcess(RefreshMainform), new object[]{inputchart,chartindex,pointIndex});
}
else
{
inputchart.ChartAreas["Default"+chartindex].AxisX.Maximum = pointIndex;
}
} public void threadDo()
{
if (chart1.ChartAreas["Default1"].AxisX.Maximum < pointIndex)
{
RefreshUI(chart1, 1, pointIndex);
}
if (chart2.ChartAreas["Default2"].AxisX.Maximum < pointIndex)
{
RefreshUI(chart2, 2, pointIndex);
}
if (chart3.ChartAreas["Default3"].AxisX.Maximum < pointIndex)
{
RefreshUI(chart3, 3, pointIndex);
}
}