[问题] 如何将阵列值定时依序写入richtextbox?

楼主: ss0987316069 (Xagittarius)   2015-01-22 14:48:00
目前程式的资料是要用来描绘图形的
阵列中共有100笔资料
我使用for循环去跑
他会将100笔资料都显示在richtextbox中
但是图形只会描绘最后一个点
但是如果我一笔一笔资料去输入
图形就可以完整描绘出来
请问for循环是不是只触发一次richtextbox所以才会只描绘出一个点
如果我要让我的阵列每隔0.5秒就依序显示一笔
(0.5秒>资料一>0.5秒>资料二>...这样)
并且每一笔都可以触发到使我的波形可以绘制
请问该怎么做呢?
附上部分程式码 :
private void AddText(MsgType msgtype, string msg)
{
int data;
System.DateTime currentTime = new System.DateTime();
currentTime = System.DateTime.Now;
string now_ms = currentTime.Millisecond.ToString();
string strT = currentTime.ToString("u");
richTextBox1.Invoke(new EventHandler(delegate
{
//richTextBox1.SelectedText = string.Empty;
richTextBox1.SelectionFont = new Font(richTextBox1.SelectionFont, FontStyle.Bold);
richTextBox1.SelectionColor = MsgTypeColor[(int)msgtype];
richTextBox1.AppendText(msg);
data = Convert.ToInt32(msg); //转换型态
statusChart1.Value = data; //描绘图形值
richTextBox1.ScrollToCaret();
}));
}

Links booklink

Contact Us: admin [ a t ] ucptt.com