日期:2014-05-17 浏览次数:20886 次
public void Set_labelText(XmlNode strText)
{
this.Invoke((Action<XmlNode>)delegate(XmlNode node)
{
StationData stationData = new StationData(node);
//stationData.IsShow = false;
Program.listStationList.Add(stationData);
this.flowLayoutPanel1.BackColor = Color.Orange;
Label lab = new Label();//实例一个label显示
lab.Name = "lab" + stationData.CardFlagID.ToString();
lab.AutoSize = false;
lab.Size = new Size(280, 140);
lab.BorderStyle = BorderStyle.Fixed3D;
lab.Text = stationData.StatinName;
lab.Font = new Font("宋体", 11);
if (stationData.IsShow)
{
lab.BackColor = Color.Green;
}
if (stationData.IsShow)
{
System.Threading.Timer tim = new System.Threading.Timer(ti, stationData.CardFlagID, 0, 10000);
//超过0秒后,以及此后每隔10秒间隔,都会调用一次由TimerCallback(ShowDataToScreenStation)指定的委托。
//每隔10秒,刷新一次检测站数据
dicThread.Add(stationData.CardFlagID.ToString(), tim);
}