コード例 #1
0
        /// <summary>
        /// 更新点位列表框
        /// </summary>
        private void UpdatePointCombo()
        {
            //加载当前产品的点位信息
            List <string> pList = new List <string>();

            pointCombo.Items.Clear();
            pointCombo.SelectedIndex = -1;
            pointCombo.Text          = "";
            pList     = iniFileOp.ReadKeys(curProductName);
            pointList = pList;

            if (pList.Count <= 0)
            {
                return;
            }

            pointCombo.Items.AddRange(pList.ToArray());
            pointCombo.SelectedIndex = 0;
            ClearTable();//先清空表格再添加新的数据

            //加载点位信息到表格中去
            for (int i = 0; i < pList.Count; i++)
            {
                string   val       = iniFileOp.ReadValue(curProductName, pList[i]);
                string[] pointUnit = val.Split(',');

                for (int j = 0; j < pointUnit.Count(); j++)
                {
                    dataGridView1.Rows[j].Cells[i + 1].Value = pointUnit[j];
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// 更新点位列表框
        /// </summary>
        private void UpdatePointCombo()
        {
            //加载当前产品的点位信息
            List <string> pList = new List <string>();

            pointCombo.Items.Clear();
            pointCombo.SelectedIndex = -1;
            pointCombo.Text          = "";
            pList     = iniFileOp.ReadKeys(curProductName);
            pointList = pList;  //点的名称链表

            if (pList.Count <= 0)
            {
                return;
            }

            pointCombo.Items.AddRange(pList.ToArray());
            pointCombo.SelectedIndex = 0;
            AddDataToTable();
        }