解决方案 »

  1.   

    很奇怪的问题是:里面数据确实是更新过来了,为什么将this.ShowChart6();这一句放在窗体的Load事件里就能够正确?而放在时间那个里面的时候就不能更新控件?
      

  2.   

    Timer的Interval、Enabled属性怎么设置的,Tick事件有没有关联给Timer_Tick
      

  3.   

    这个Timer控件都没有问题,我调试到那里了,值都已经赋给了Chart的Points,但是图就是不更新,现在的解决方法还是要重新添加点,不能给原来的点重新赋值,如下:
            private void ShowChart6()
            {
                this.chart6.Series[0].Points.Clear();
                this.chart6.Series[1].Points.Clear();
                this.chart6.Series[2].Points.Clear();
                for (int groupIndex = 0; groupIndex < 12; groupIndex++)
                {
                    DataPoint dPoint1 = new DataPoint(0, Convert.ToDouble(this.CountList.Groups[groupIndex].Items[0].SubItems[1].Text));
                    dPoint1.AxisLabel = this.CountList.Groups[groupIndex].Header;
                    DataPoint dPoint2 = new DataPoint(0, Convert.ToDouble(this.CountList.Groups[groupIndex].Items[1].SubItems[1].Text)); 
                    DataPoint dPoint3 = new DataPoint(0, Convert.ToDouble(this.CountList.Groups[groupIndex].Items[2].SubItems[1].Text));
                    this.chart6.Series[0].Points.Add(dPoint1);
                    this.chart6.Series[1].Points.Add(dPoint2);
                    this.chart6.Series[2].Points.Add(dPoint3);
                }
            }
      

  4.   

    如果直接调用 ShowChart6()正常,那放在timer里也应该正常,你timer的Interval设置为多少
      

  5.   

    开始是500,
            private void timer_Tick(object sender, EventArgs e)
            {
                if (updateWinform)
                {
                    updateWinform = false;
                    this.timer.Enabled = false;
                    this.ShowChart6();
                    this.timer.Interval = 20000;
                    this.timer.Enabled = true;
                }
            }
      

  6.   

    这个放在load里吧,这样试试
                    this.timer.Interval = 20000;
                    this.timer.Enabled = true;
      
     if (updateWinform)
                {
                 this.ShowChart6();
                    updateWinform = false;
                    this.timer.Enabled = false;
    }
      

  7.   

    我之前是
                    this.timer.Interval = 500;
                    this.timer.Enabled = true;
    我不知道改成200000有什么不一样?没有试,我现在用的是4楼的办法,重新加。
    但是遇到一个问题,就是在其他电脑上不能用,出现一个错误。如我另外一个帖子所述http://bbs.csdn.net/topics/390785694
    现在我的解决方案是修改引用的设置,如图,不知道有没有更好的办法?