Exemple #1
0
        private void frmQualityInspecting_Ionitriding_Shown(object sender, EventArgs e)
        {
            ilstDevices.Items.Clear();

            GetStations(
                IRAPUser.Instance.CommunityID,
                IRAPUser.Instance.SysLogID);

            if (stations.Count <= 0)
            {
                XtraTabPage page = new XtraTabPage();
                page.Name         = "emptyPage";
                page.TabPageWidth = 0;

                LabelControl label = new LabelControl();
                label.Appearance.Font = new Font("微软雅黑", 18f, FontStyle.Bold);
                label.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                label.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
                label.Appearance.Options.UseFont        = true;
                label.Appearance.Options.UseTextOptions = true;
                label.AutoSizeMode = LabelAutoSizeMode.None;
                label.Dock         = DockStyle.Fill;
                label.Text         = "还没有配置设备!";
                page.Controls.Add(label);

                tcMain.TabPages.Add(page);
            }
            else
            {
                foreach (WIPStation station in stations)
                {
                    #region 创建设备生产情况页
                    XtraTabPage page = new XtraTabPage();
                    page.Text = station.ToString();
                    page.Name = station.T133Code;

                    UserControls.ucQualityInspecting_Furnace prdt =
                        new UserControls.ucQualityInspecting_Furnace(station);
                    prdt.Dock = DockStyle.Fill;
                    page.Controls.Add(prdt);

                    tcMain.TabPages.Add(page);
                    #endregion

                    #region 创建设备列表项
                    ilstDevices.Items.Add(station, -1);
                    #endregion
                }
            }
        }