public static void DoubleBuffered(this TableLayoutPanel tlp, bool setting) { Type tlpType = tlp.GetType(); PropertyInfo pi = tlpType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic); pi.SetValue(tlp, setting, null); }
private static TableLayoutPanel CreateTableLayoutPanel() { int row = 10; int col = 3; TableLayoutPanel tlpLayout = new TableLayoutPanel(); tlpLayout.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; tlpLayout.Dock = DockStyle.Fill; tlpLayout.RowCount = row; tlpLayout.ColumnCount = col; for (int i = 0; i < row; i++) { tlpLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); } for (int i = 0; i < col; i++) { tlpLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); } //设置tablelayoutpanel控件的DoubleBuffered 属性为true,这样可以减少或消除由于不断重绘所显示图面的某些部分而导致的闪烁 tlpLayout.GetType() .GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(tlpLayout, true, null); return(tlpLayout); }
public void FillWaitInfoListIntoTabelLayoutPanel(TableLayoutPanel layoutPanel, List <WaitInfoV1d0> waitInfoList) { int waitInfoCount = waitInfoList.Count; layoutPanel.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(layoutPanel, true, null); layoutPanel.SuspendLayout(); if (layoutPanel.RowCount != waitInfoCount) { layoutPanel.Height = waitInfoCount * 100; layoutPanel.RowCount = waitInfoCount; layoutPanel.RowStyles.Clear(); for (int i = 0; i < waitInfoCount; i++) { if (i < (waitInfoCount - 1)) { layoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 100)); } else { layoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } } } layoutPanel.Controls.Clear(); for (int i = 0; i < waitInfoCount; i++) { QueueInfoDisplayBarV1d0 displayBar = new QueueInfoDisplayBarV1d0(waitInfoList[i]); displayBar.Dock = DockStyle.Fill; layoutPanel.Controls.Add(displayBar, 1, i); } layoutPanel.ResumeLayout(); }
/// <summary> /// 创建UI库位母治具控件 /// </summary> private void CreateMontherControl() { try { //初始化母治具 panelFix = new List <TableLayoutPanel>(); int mSLot = 0; for (int rom = 0; rom < CGlobalPara.C_ROOM_MAX; rom++) { for (int i = 0; i < CGlobalPara.C_ROW_MAX; i++) { for (int j = 0; j < CGlobalPara.C_COL_MAX; j++) { Label labSlot = new Label(); labSlot.Name = "labSlot" + mSLot.ToString(); if (CYOHOOApp.ColPos == 0) { labSlot.Text = (j + 1).ToString("D2"); } else { labSlot.Text = (CGlobalPara.C_COL_MAX - j).ToString("D2"); } labSlot.Dock = DockStyle.Fill; labSlot.TextAlign = ContentAlignment.MiddleCenter; labSlot.Font = new Font("宋体", 9); labSlot.Margin = new Padding(0); labFixSlot.Add(labSlot); TableLayoutPanel panel = new TableLayoutPanel(); panel.Dock = DockStyle.Fill; panel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset; panel.Margin = new Padding(1); panel.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panel, true, null); panel.RowCount = 1; panel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); panel.ColumnCount = 2; panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50)); panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50)); panelFix.Add(panel); mSLot += 1; } } } } catch (Exception) { throw; } }
private void treeTool_AfterSelect(object sender, TreeViewEventArgs e) { if (treeTool.SelectedNode.Index == 0) { if (dataType == DataType.DataType.Geodetic && isCalculate == false) { BLToXYTable bLtoXY = new BLToXYTable(); tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); bLtoXY.DrawTable(pnlResult, col0.Count, ref tableLayoutPanel); InputBLToXY.GetData(col0, col1, col2, ref tableLayoutPanel); tableType = 11; } } else if (treeTool.SelectedNode.Index == 1) { if (dataType == DataType.DataType.Gauss && isCalculate == false) { XYToBLTable xYtoBL = new XYToBLTable(); tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); xYtoBL.DrawTable(pnlResult, col0.Count, ref tableLayoutPanel); InputXYToBL.GetData(col0, col1, col2, ref tableLayoutPanel); tableType = 12; } } else if (treeTool.SelectedNode.Index == 2) { if (dataType == DataType.DataType.Gauss && isCalculate == false) { XYToXYTable xYtoXY = new XYToXYTable(); tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); xYtoXY.DrawTable(pnlResult, col0.Count, ref tableLayoutPanel); InputXYToXY.GetData(col0, col1, col2, ref tableLayoutPanel); tableType = 13; } } }
public static void InitializeTableLayoutPanel(TableLayoutPanel container, int rowCount, int columnCount) { if (rowCount != 0 && columnCount != 0) { container.ColumnCount = columnCount; container.RowCount = rowCount; container.RowStyles.Clear(); int percent = 100 / container.RowCount; for (int i = 0; i < container.RowCount; i++) { container.RowStyles.Add(new RowStyle(SizeType.Percent, percent)); } container.ColumnStyles.Clear(); percent = 100 / container.ColumnCount; for (int i = 0; i < container.ColumnCount; i++) { container.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, percent)); } container.Dock = System.Windows.Forms.DockStyle.Fill; container.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(container, true, null); } }
private void treeRecord_AfterSelect(object sender, TreeViewEventArgs e) { if (treeRecord.SelectedNode.Index == 0) { if (approximateDataType == DataType.Data.ConnectingTraverse || approximateDataType == DataType.Data.OpenTraverse) { if (isCalculate == false) { tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); TraverseRecordTable.DrawTable(pnlResult, dataCount, ref tableLayoutPanel); InputTraverseRecordTable.GetData(pnlResult, dataCount, backCount, approximateDataType, ref tableLayoutPanel); dataType = DataType.DataType.HandMade; tableType = 1; } } } else if (treeRecord.SelectedNode.Index == 1) { if (approximateDataType == DataType.Data.ConnectingTraverse || approximateDataType == DataType.Data.OpenTraverse) { if (isCalculate == false) { tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); LevelingRecordTable.DrawTable(pnlResult, dataCount, ref tableLayoutPanel); InputLevelingRecordTable.GetData(pnlResult, dataCount, backCount, approximateDataType, ref tableLayoutPanel); dataType = DataType.DataType.HandMade; tableType = 2; } } } else if (treeRecord.SelectedNode.Index == 2) { } }
/// <summary> /// 刷新设置 /// </summary> /// <param name="StatFlow"></param> private void RefreshFlowPanel(List <CGJWeb.CSTAT_FLOW> StatFlow) { if (FlowPanel != null) { foreach (Control item in FlowPanel.Controls) { item.Dispose(); } FlowPanel.Dispose(); FlowPanel = null; } labStatId.Clear(); txtStatName.Clear(); cmbFlowId.Clear(); txtFlowName.Clear(); cmbDisable.Clear(); FlowPanel = new TableLayoutPanel(); FlowPanel.Dock = DockStyle.Fill; FlowPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; FlowPanel.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(FlowPanel, true, null); FlowPanel.RowCount = StatFlow.Count + 2; for (int i = 0; i < StatFlow.Count + 1; i++) { FlowPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 24)); } FlowPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); FlowPanel.ColumnCount = 6; FlowPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 80)); FlowPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100)); FlowPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 80)); FlowPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100)); FlowPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 80)); FlowPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); Label labT1 = new Label(); labT1.Dock = DockStyle.Fill; labT1.Margin = new Padding(1); labT1.TextAlign = ContentAlignment.MiddleCenter; labT1.Text = "编号"; FlowPanel.Controls.Add(labT1, 0, 0); Label labT2 = new Label(); labT2.Dock = DockStyle.Fill; labT2.Margin = new Padding(1); labT2.TextAlign = ContentAlignment.MiddleCenter; labT2.Text = "站别名称"; FlowPanel.Controls.Add(labT2, 1, 0); Label labT3 = new Label(); labT3.Dock = DockStyle.Fill; labT3.Margin = new Padding(1); labT3.TextAlign = ContentAlignment.MiddleCenter; labT3.Text = "流程编号"; FlowPanel.Controls.Add(labT3, 2, 0); Label labT4 = new Label(); labT4.Dock = DockStyle.Fill; labT4.Margin = new Padding(1); labT4.TextAlign = ContentAlignment.MiddleCenter; labT4.Text = "流程名称"; FlowPanel.Controls.Add(labT4, 3, 0); Label labT5 = new Label(); labT5.Dock = DockStyle.Fill; labT5.Margin = new Padding(1); labT5.TextAlign = ContentAlignment.MiddleCenter; labT5.Text = "使用状态"; FlowPanel.Controls.Add(labT5, 4, 0); for (int i = 0; i < StatFlow.Count; i++) { Label lab1 = new Label(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(1); lab1.Text = (i + 1).ToString(); lab1.TextAlign = ContentAlignment.MiddleCenter; labStatId.Add(lab1); TextBox txt1 = new TextBox(); txt1.Dock = DockStyle.Fill; txt1.Margin = new Padding(1); txt1.TextAlign = HorizontalAlignment.Center; txt1.Text = StatFlow[i].StatName; txtStatName.Add(txt1); ComboBox cmb1 = new ComboBox(); cmb1.Dock = DockStyle.Fill; cmb1.Margin = new Padding(1); cmb1.DropDownStyle = ComboBoxStyle.DropDownList; for (int z = 0; z < 12; z++) { cmb1.Items.Add(z + 1); } cmb1.SelectedIndex = StatFlow[i].FlowId - 1; cmbFlowId.Add(cmb1); TextBox txt2 = new TextBox(); txt2.Dock = DockStyle.Fill; txt2.Margin = new Padding(1); txt2.TextAlign = HorizontalAlignment.Center; txt2.Text = StatFlow[i].FlowName; txtFlowName.Add(txt2); ComboBox cmb2 = new ComboBox(); cmb2.Dock = DockStyle.Fill; cmb2.Margin = new Padding(1); cmb2.DropDownStyle = ComboBoxStyle.DropDownList; cmb2.Items.Add("启用"); cmb2.Items.Add("禁用"); cmb2.SelectedIndex = StatFlow[i].Disable; cmbDisable.Add(cmb2); FlowPanel.Controls.Add(labStatId[i], 0, i + 1); FlowPanel.Controls.Add(txtStatName[i], 1, i + 1); FlowPanel.Controls.Add(cmbFlowId[i], 2, i + 1); FlowPanel.Controls.Add(txtFlowName[i], 3, i + 1); FlowPanel.Controls.Add(cmbDisable[i], 4, i + 1); } panel6.Controls.Add(FlowPanel, 0, 1); }
/// <summary> /// 加载20通道界面 /// </summary> private void load_Max_UUT(int uutMax) { try { //治具界面 if (panelUUT != null) { foreach (Control item in panelUUT.Controls) { panelUUT.Controls.Remove(item); item.Dispose(); } labUUT.Clear(); panelUUT.Dispose(); panelUUT = null; } for (int i = 0; i < uutMax; i++) { Label lab = new Label(); lab.Name = "labUUT" + i.ToString(); lab.Dock = DockStyle.Fill; lab.Margin = new Padding(0); lab.TextAlign = ContentAlignment.MiddleCenter; lab.BackColor = Color.White; lab.Text = ""; labUUT.Add(lab); } //初始化panelUUT int N = _uutMax / 2; panelUUT = new TableLayoutPanel(); panelUUT.Dock = DockStyle.Fill; panelUUT.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset; panelUUT.Margin = new Padding(0); panelUUT.RowCount = N; panelUUT.ColumnCount = 2; panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); for (int i = 0; i < N; i++) { panelUUT.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } for (int i = 0; i < N; i++) { if (_fixPos == 0) { panelUUT.Controls.Add(labUUT[i], 0, i); panelUUT.Controls.Add(labUUT[i + N], 1, N - i - 1); } else { ; panelUUT.Controls.Add(labUUT[i + N], 0, i); panelUUT.Controls.Add(labUUT[N - i - 1], 1, i); } } panelUUT.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelUUT, true, null); this.Controls.Add(labStatus); } catch (Exception) { throw; } }
private void Display(object sender, DataEventArgs e) { IEnumerable <StockInfo> stockList = e.Stocks; if (!DataService.EnableStock) { stockList = stockList.Where(r => r.IsSilver); } try { #region format //简单通知 //string notifyFormat = "{0}:{1}{2}%{6}%"; string tipsFormat = @"{0} 涨:{9}% 换:{14}% 盈:{11} 现价:{3} 成本:{13} 股:{12} 最高:{4} 最低:{5} 今开:{1} 昨收:{2} 成交量/额:{6}手/{7}万元 买: 卖: {15} 代码:{16} 板块:{17} {18} 时间:{8} 当前:{10}"; string fiveDealFormat = @"{0}:{1} {2}:{3}"; #endregion #region 桌面控件初始化 TableLayoutPanel tableLayoutPanel1 = new TableLayoutPanel(); tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(tableLayoutPanel1, true, null); tableLayoutPanel1.SuspendLayout(); var rowStyle = new RowStyle(SizeType.Absolute, 9); for (int j = 0; j < 50; j++) { tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 10)); } tableLayoutPanel1.ColumnCount = 1; tableLayoutPanel1.RowCount = stockList.Count(); tableLayoutPanel1.Height = tableLayoutPanel1.RowCount * 10; tableLayoutPanel1.Dock = DockStyle.Fill; List <Control> controls = new List <Control>(); foreach (Control item in tableLayoutPanel1.Controls) { controls.Add(item); } foreach (var item in controls) { item.Dispose(); } tableLayoutPanel1.Controls.Clear(); #endregion int rowIndex = 0; ToolTip tip = new ToolTip(); #region 显示每一只股票 //只显示指定的股票 并且先按Order+BuyCount排序 var stocks = stockList.Where(row => row.ShowInFolatWindow).OrderByDescending(row => row.Order).ThenByDescending(row => row.BuyCount); foreach (var rtStock in stocks) { Label stockLabel = this.GetNewlabel(rtStock.Order >= -1 && rtStock.Order <= 1); stockLabel.ForeColor = GetWarnColor(rtStock); #region 股票桌面信息 stockLabel.Tag = rtStock.Code; string nameInShort = GetUpOrDownArrowCompareToLastDay(rtStock) + " " + rtStock.SpellingInShort.PadLeft(4, ' '); stockLabel.Text = string.Format(Constants.Setting.DeskDisplayFormat , nameInShort //简称 , Math.Round(rtStock.PriceNow, rtStock.PriceNow >= 1000 ? 1 : 2).ToString().PadLeft(6, ' ') //当前价格 , (rtStock.SurgedRange.ToString() + "%").PadLeft(7, ' ') //当日涨幅 , (rtStock.CurrentProfit.ToString()).PadLeft(6, ' ') //当前盈亏 , Math.Round(rtStock.SumProfit, 0).ToString().PadLeft(6, ' ') //总盈亏 , (Math.Round(rtStock.SumProfitPercent * 100, 2).ToString() + "%").PadLeft(8, ' ') //总盈亏比例 , Math.Round(rtStock.BuyPrice, 2).ToString().PadLeft(6, ' ') //成本价 , rtStock.BuyCount.ToString().PadLeft(5, ' ') //股数 , (rtStock.TurnOver.ToString() + "%").PadLeft(7, ' ') //换手率 , rtStock.MarketValue.ToString().PadLeft(6, ' ') //当前市值 , Math.Round(rtStock.SumCost, 0).ToString().PadLeft(6, ' ') ); #endregion #region 股票提示信息 string fiveDeal = new StringBuilder() .AppendFormat(fiveDealFormat, rtStock.Buy1Price.ToString().PadLeft(5, ' '), rtStock.Buy1Count.ToString().PadLeft(6, ' '), rtStock.Sell1Price.ToString().PadLeft(5, ' '), rtStock.Sell1Count.ToString().PadLeft(6, ' ')).AppendLine() .AppendFormat(fiveDealFormat, rtStock.Buy2Price.ToString().PadLeft(5, ' '), rtStock.Buy2Count.ToString().PadLeft(6, ' '), rtStock.Sell2Price.ToString().PadLeft(5, ' '), rtStock.Sell2Count.ToString().PadLeft(6, ' ')).AppendLine() .AppendFormat(fiveDealFormat, rtStock.Buy3Price.ToString().PadLeft(5, ' '), rtStock.Buy3Count.ToString().PadLeft(6, ' '), rtStock.Sell3Price.ToString().PadLeft(5, ' '), rtStock.Sell3Count.ToString().PadLeft(6, ' ')).AppendLine() .AppendFormat(fiveDealFormat, rtStock.Buy4Price.ToString().PadLeft(5, ' '), rtStock.Buy4Count.ToString().PadLeft(6, ' '), rtStock.Sell4Price.ToString().PadLeft(5, ' '), rtStock.Sell4Count.ToString().PadLeft(6, ' ')).AppendLine() .AppendFormat(fiveDealFormat, rtStock.Buy5Price.ToString().PadLeft(5, ' '), rtStock.Buy5Count.ToString().PadLeft(6, ' '), rtStock.Sell5Price.ToString().PadLeft(5, ' '), rtStock.Sell5Count.ToString().PadLeft(6, ' ')) .ToString(); string stockTips = string.Format(tipsFormat , rtStock.Name , rtStock.PriceTodayStart , rtStock.PriceYesterdayEnd , rtStock.PriceNow , rtStock.PriceTodayHigh , rtStock.PriceTodayLow , rtStock.DealsStockAmt , rtStock.DealsMoney , rtStock.DateTime , rtStock.SurgedRange , rtStock.Now , rtStock.CurrentProfit , rtStock.BuyCount , rtStock.BuyPrice , rtStock.TurnOver , fiveDeal , rtStock.Code , rtStock.CategroyDesc , rtStock.Description ); tip.SetToolTip(stockLabel, stockTips); #endregion tableLayoutPanel1.Controls.Add(stockLabel, 0, rowIndex); rowIndex++; } #endregion #region 表格标题信息 Label columnNamesLabel = GetNewlabel(true); columnNamesLabel.Click += new EventHandler((label, args) => { EnableDisableAutoHide(); }); columnNamesLabel.Text = string.Format(Constants.Setting.DeskDisplayFormat , "Name".PadLeft(6, ' ') //简称 , "Now¥".PadLeft(6, ' ') //当前价格 , "↓↑%".PadLeft(7, ' ') //当日涨幅 , "PF".PadLeft(6, ' ') //当前盈亏 , "∑PF".PadLeft(6, ' ') //总盈亏 , "∑PF%".PadLeft(8, ' ') //总盈亏比例 , "Cost¥".PadLeft(6, ' ') //成本价 , "*".PadLeft(5, ' ') //股数 , "Turn%".PadLeft(7, ' ') //换手率 , "Mkt¥".PadLeft(6, ' ') //当前市值 , "∑Cost¥".PadLeft(6, ' ') //总成本 ); tip.SetToolTip(columnNamesLabel, string.Format(Constants.Setting.DeskDisplayFormat , "Name:简称" + Environment.NewLine //简称 , "Now¥:当前价格" + Environment.NewLine //当前价格 , "↓↑%:当日涨幅" + Environment.NewLine //当日涨幅 , "PF:当前盈亏" + Environment.NewLine //当前盈亏 , "∑PF:总盈亏" + Environment.NewLine //总盈亏 , "∑PF%:总盈亏比例" + Environment.NewLine //总盈亏比例 , "Cost¥:成本价" + Environment.NewLine //成本价 , "*:股数" + Environment.NewLine //股数 , "Turn%:换手率" + Environment.NewLine //换手率 , "Mkt¥:当前市值" + Environment.NewLine //当前市值 , "∑Cost¥:总成本" + Environment.NewLine //总成本 )); tableLayoutPanel1.Controls.Add(columnNamesLabel, 0, rowIndex++); #endregion #region 总盈亏信息 string[] summaryInfo = new string[] { "", "" }; if (DataService.EnableStock) { summaryInfo = GetStockSummaryMessage(stockList); } string summaryMessage = string.Format("{0}{1}", summaryInfo[0], e.Stocks.FirstOrDefault(r => r.IsSilver).PriceNow); Label summaryLabel = GetNewlabel(); tableLayoutPanel1.Tag = summaryLabel.Text = summaryMessage; if (!DataService.EnableStock) { summaryLabel.Text = ""; } tip.SetToolTip(summaryLabel, summaryInfo[1]); tableLayoutPanel1.Controls.Add(summaryLabel, 0, rowIndex++); #endregion tableLayoutPanel1.ResumeLayout(); #region 实时显示股票警告信息到桌面标题 FormInvokArgument argument = new FormInvokArgument() { tableLayoutPanel1 = tableLayoutPanel1, }; if (this.InvokeRequired == true) { this.Invoke(new Action <FormInvokArgument>(ShowStockInDesk), argument); } else { ShowStockInDesk(argument); } #endregion } catch (Exception ex) { MessageSvc.Default.Write(MessageLevel.Error, ex); } }
private void InitialSnPanel(int slotMax) { if (SnPanel != null) { foreach (Control item in SnPanel.Controls) { item.Dispose(); } SnPanel.Dispose(); SnPanel = null; } txtSn.Clear(); txtSnFlow.Clear(); cmbSnResult.Clear(); SnPanel = new TableLayoutPanel(); SnPanel.Dock = DockStyle.Fill; SnPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; SnPanel.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(SnPanel, true, null); SnPanel.RowCount = slotMax + 1; SnPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); for (int i = 0; i < slotMax; i++) { SnPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } SnPanel.ColumnCount = 4; SnPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 60)); SnPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); SnPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 80)); SnPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 60)); Label labT1 = new Label(); labT1.Dock = DockStyle.Fill; labT1.Margin = new Padding(1); labT1.TextAlign = ContentAlignment.MiddleCenter; labT1.Text = "编号"; SnPanel.Controls.Add(labT1, 0, 0); Label labT2 = new Label(); labT2.Dock = DockStyle.Fill; labT2.Margin = new Padding(1); labT2.TextAlign = ContentAlignment.MiddleCenter; labT2.Text = "产品条码"; SnPanel.Controls.Add(labT2, 1, 0); Label labT3 = new Label(); labT3.Dock = DockStyle.Fill; labT3.Margin = new Padding(1); labT3.TextAlign = ContentAlignment.MiddleCenter; labT3.Text = "流程名称"; SnPanel.Controls.Add(labT3, 2, 0); Label labT4 = new Label(); labT4.Dock = DockStyle.Fill; labT4.Margin = new Padding(1); labT4.TextAlign = ContentAlignment.MiddleCenter; labT4.Text = "结果"; SnPanel.Controls.Add(labT4, 3, 0); for (int i = 0; i < slotMax; i++) { Label lab1 = new Label(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(1); lab1.Text = (i + 1).ToString("D2"); lab1.TextAlign = ContentAlignment.MiddleCenter; SnPanel.Controls.Add(lab1, 0, i + 1); TextBox txt1 = new TextBox(); txt1.Dock = DockStyle.Fill; txt1.Margin = new Padding(1); txt1.TextAlign = HorizontalAlignment.Center; txt1.Text = "A000000" + (i + 1).ToString("D2"); txtSn.Add(txt1); SnPanel.Controls.Add(txtSn[i], 1, i + 1); TextBox txt2 = new TextBox(); txt2.Dock = DockStyle.Fill; txt2.Margin = new Padding(1); txt2.TextAlign = HorizontalAlignment.Center; txt2.Text = ""; txtSnFlow.Add(txt2); SnPanel.Controls.Add(txtSnFlow[i], 2, i + 1); ComboBox cmb1 = new ComboBox(); cmb1.Dock = DockStyle.Fill; cmb1.Margin = new Padding(1); cmb1.DropDownStyle = ComboBoxStyle.DropDownList; cmb1.Items.Add("良品"); cmb1.Items.Add("不良"); cmb1.SelectedIndex = 0; cmbSnResult.Add(cmb1); SnPanel.Controls.Add(cmbSnResult[i], 3, i + 1); } panel11.Controls.Add(SnPanel, 1, 0); }
/// <summary> /// 加载16通道界面 /// </summary> private void load_Max_UUT16() { try { for (int i = 0; i < _uutMax; i++) { Label lab1 = new Label(); lab1.Name = "labUUTNo" + i.ToString(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(0); lab1.TextAlign = ContentAlignment.MiddleCenter; lab1.Text = (i + 1).ToString("D2"); labUUTNo.Add(lab1); Label lab2 = new Label(); lab2.Name = "labUUT" + i.ToString(); lab2.Dock = DockStyle.Fill; lab2.Margin = new Padding(0); lab2.TextAlign = ContentAlignment.MiddleCenter; lab2.Text = ""; lab2.BackColor = Color.White; labUUT.Add(lab2); Label lab3 = new Label(); lab3.Name = "labNo" + i.ToString(); lab3.Dock = DockStyle.Fill; lab3.Margin = new Padding(0); lab3.TextAlign = ContentAlignment.MiddleCenter; lab3.Text = (i + 1).ToString("D2"); labNo.Add(lab3); Label lab4 = new Label(); lab4.Name = "labSn" + i.ToString(); lab4.Dock = DockStyle.Fill; lab4.Margin = new Padding(0); lab4.TextAlign = ContentAlignment.MiddleCenter; lab4.Text = ""; labSn.Add(lab4); Label lab5 = new Label(); lab5.Name = "labResult" + i.ToString(); lab5.Dock = DockStyle.Fill; lab5.Margin = new Padding(0); lab5.TextAlign = ContentAlignment.MiddleCenter; lab5.Text = ""; labResult.Add(lab5); } //初始化panelUUT int N = _uutMax / 2; panelUUT = new TableLayoutPanel(); panelUUT.Dock = DockStyle.Fill; panelUUT.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset; panelUUT.Margin = new Padding(5, 25, 5, 25); panelUUT.RowCount = N; panelUUT.ColumnCount = 4; panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 28)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 28)); for (int i = 0; i < N; i++) { panelUUT.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } for (int i = 0; i < N; i++) { if (_fixPos == 0) { panelUUT.Controls.Add(labUUTNo[i], 0, i); panelUUT.Controls.Add(labUUT[i], 1, i); panelUUT.Controls.Add(labUUT[i + N], 2, N - i - 1); panelUUT.Controls.Add(labUUTNo[i + N], 3, N - i - 1); } else { panelUUT.Controls.Add(labUUTNo[i + N], 0, i); panelUUT.Controls.Add(labUUT[i + N], 1, i); panelUUT.Controls.Add(labUUT[N - i - 1], 2, i); panelUUT.Controls.Add(labUUTNo[N - i - 1], 3, i); } } panelUUT.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelUUT, true, null); panel4.Controls.Add(panelUUT); //初始化标题 Label labT1 = new Label(); labT1.Name = "labTitle1"; labT1.Dock = DockStyle.Fill; labT1.Margin = new Padding(0); labT1.TextAlign = ContentAlignment.MiddleCenter; labT1.Text = CLanguage.Lan("编号"); labT1.Tag = "编号"; Label labT2 = new Label(); labT2.Name = "labTitle2"; labT2.Dock = DockStyle.Fill; labT2.Margin = new Padding(0); labT2.TextAlign = ContentAlignment.MiddleCenter; labT2.Text = CLanguage.Lan("产品条码"); labT2.Tag = "产品条码"; Label labT3 = new Label(); labT3.Name = "labTitle3"; labT3.Dock = DockStyle.Fill; labT3.Margin = new Padding(0); labT3.TextAlign = ContentAlignment.MiddleCenter; labT3.Text = CLanguage.Lan("结果"); labT3.Tag = "结果"; //初始化panelSn panelSn = new TableLayoutPanel(); panelSn.Dock = DockStyle.Fill; panelSn.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; panelSn.Margin = new Padding(1); panelSn.RowCount = _uutMax + 1; panelSn.ColumnCount = 3; panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 32)); panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 42)); panelSn.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); for (int i = 0; i < _uutMax; i++) { panelSn.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } panelSn.Controls.Add(labT1, 0, 0); panelSn.Controls.Add(labT2, 1, 0); panelSn.Controls.Add(labT3, 2, 0); for (int i = 0; i < _uutMax; i++) { panelSn.Controls.Add(labNo[i], 0, i + 1); panelSn.Controls.Add(labSn[i], 1, i + 1); panelSn.Controls.Add(labResult[i], 2, i + 1); } panelSn.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelSn, true, null); panel1.Controls.Add(panelSn, 1, 0); } catch (Exception) { throw; } }
public void SetItem(CHPPara.CStep stepItem) { step = stepItem; if (panelStep != null) { foreach (Control item in panelStep.Controls) { item.Dispose(); } labStepName = null; txtStepVal = null; labStepDes = null; panelStep.Dispose(); } int itemNum = step.para.Count; labItemName.Text = CLanguage.Lan(step.des); panelStep = new TableLayoutPanel(); panelStep.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelStep, true, null); panelStep.Dock = DockStyle.Fill; panelStep.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; panelStep.RowCount = itemNum + 1; panelStep.ColumnCount = 3; for (int i = 0; i < itemNum; i++) { panelStep.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); } panelStep.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); panelStep.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120)); panelStep.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120)); panelStep.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 120)); labStepName = new Label[itemNum]; txtStepVal = new TextBox[itemNum]; labStepDes = new Label[itemNum]; for (int i = 0; i < itemNum; i++) { labStepName[i] = new Label(); labStepName[i].Name = "stepName" + i.ToString(); labStepName[i].Dock = DockStyle.Fill; labStepName[i].TextAlign = ContentAlignment.MiddleLeft; labStepName[i].Text = CLanguage.Lan(step.para[i].name) + ":"; panelStep.Controls.Add(labStepName[i], 0, i); txtStepVal[i] = new TextBox(); txtStepVal[i].Name = "stepVal" + i.ToString(); txtStepVal[i].Dock = DockStyle.Fill; txtStepVal[i].TextAlign = HorizontalAlignment.Center; txtStepVal[i].Text = step.para[i].setVal.ToString(); txtStepVal[i].KeyPress += new KeyPressEventHandler(OnStepValKeyPress); txtStepVal[i].TextChanged += new EventHandler(OnStepValChange); panelStep.Controls.Add(txtStepVal[i], 1, i); labStepDes[i] = new Label(); labStepDes[i].Name = "stepDes" + i.ToString(); labStepDes[i].Dock = DockStyle.Fill; labStepDes[i].TextAlign = ContentAlignment.MiddleLeft; labStepDes[i].Text = CLanguage.Lan(step.para[i].unitDes); panelStep.Controls.Add(labStepDes[i], 2, i); } splitContainer1.Panel2.Controls.Add(panelStep); }
/// <summary> /// 加载16通道界面 /// </summary> private void load_Max_UUT16() { try { for (int i = 0; i < _uutMax; i++) { Label lab1 = new Label(); lab1.Name = "labNo" + i.ToString(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(0); lab1.TextAlign = ContentAlignment.MiddleCenter; lab1.Text = (i + 1).ToString("D2"); labNo.Add(lab1); Label lab2 = new Label(); lab2.Name = "labV" + i.ToString(); lab2.Dock = DockStyle.Fill; lab2.Margin = new Padding(0); lab2.TextAlign = ContentAlignment.MiddleCenter; lab2.Text = ""; labV.Add(lab2); Label lab3 = new Label(); lab3.Name = "labI" + i.ToString(); lab3.Dock = DockStyle.Fill; lab3.Margin = new Padding(0); lab3.TextAlign = ContentAlignment.MiddleCenter; lab3.Text = ""; labI.Add(lab3); Label lab4 = new Label(); lab4.Name = "labResult" + i.ToString(); lab4.Dock = DockStyle.Fill; lab4.Margin = new Padding(0); lab4.TextAlign = ContentAlignment.MiddleCenter; lab4.Text = ""; labResult.Add(lab4); } //初始化panelUUT int N = _uutMax / 2; panelUUT = new TableLayoutPanel(); panelUUT.Dock = DockStyle.Fill; panelUUT.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; panelUUT.Margin = new Padding(3); panelUUT.RowCount = N + 1; panelUUT.ColumnCount = 8; panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 42)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 42)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.RowStyles.Add(new RowStyle(SizeType.Absolute, 24)); for (int i = 0; i < N; i++) { panelUUT.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } for (int i = 0; i < 2; i++) { Label labT1 = new Label(); labT1.Name = "labT1"; labT1.Dock = DockStyle.Fill; labT1.Margin = new Padding(0); labT1.TextAlign = ContentAlignment.MiddleCenter; labT1.Text = CLanguage.Lan("编号"); labT1.Tag = "编号"; Label labT2 = new Label(); labT2.Name = "labT2"; labT2.Dock = DockStyle.Fill; labT2.Margin = new Padding(0); labT2.TextAlign = ContentAlignment.MiddleCenter; labT2.Text = CLanguage.Lan("电压(V)"); labT2.Tag = "电压(V)"; Label labT3 = new Label(); labT3.Name = "labT3"; labT3.Dock = DockStyle.Fill; labT3.Margin = new Padding(0); labT3.TextAlign = ContentAlignment.MiddleCenter; labT3.Text = CLanguage.Lan("电流(A)"); labT3.Tag = "电流(A)"; Label labT4 = new Label(); labT4.Name = "labT4"; labT4.Dock = DockStyle.Fill; labT4.Margin = new Padding(0); labT4.TextAlign = ContentAlignment.MiddleCenter; labT4.Text = CLanguage.Lan("结果"); labT4.Tag = "结果"; panelUUT.Controls.Add(labT1, 0 + 4 * i, 0); panelUUT.Controls.Add(labT2, 1 + 4 * i, 0); panelUUT.Controls.Add(labT3, 2 + 4 * i, 0); panelUUT.Controls.Add(labT4, 3 + 4 * i, 0); } for (int i = 0; i < N; i++) { panelUUT.Controls.Add(labNo[i], 0, i + 1); panelUUT.Controls.Add(labV[i], 1, i + 1); panelUUT.Controls.Add(labI[i], 2, i + 1); panelUUT.Controls.Add(labResult[i], 3, i + 1); panelUUT.Controls.Add(labNo[i + N], 4, i + 1); panelUUT.Controls.Add(labV[i + N], 5, i + 1); panelUUT.Controls.Add(labI[i + N], 6, i + 1); panelUUT.Controls.Add(labResult[i + N], 7, i + 1); } panelUUT.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelUUT, true, null); panel1.Controls.Add(panelUUT, 0, 0); } catch (Exception) { throw; } }
/// <summary> /// 加载8通道界面 /// </summary> private void load_Max_UUT8() { try { for (int i = 0; i < _uutMax; i++) { Label lab1 = new Label(); lab1.Name = "labUUTNo" + i.ToString(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(0); lab1.TextAlign = ContentAlignment.MiddleCenter; lab1.Text = (i + 1).ToString("D2"); labUUTNo.Add(lab1); Label lab2 = new Label(); lab2.Name = "labUUT" + i.ToString(); lab2.Dock = DockStyle.Fill; lab2.Margin = new Padding(0); lab2.TextAlign = ContentAlignment.MiddleCenter; lab2.Text = ""; lab2.BackColor = Color.White; labUUT.Add(lab2); CheckBox lab3 = new CheckBox(); lab3.Name = "labNo" + i.ToString(); lab3.Font = new Font("宋体", 9); lab3.Dock = DockStyle.Fill; lab3.Margin = new Padding(3, 0, 0, 0); lab3.Text = (i + 1).ToString("D2"); labNo.Add(lab3); labNo[i].CheckedChanged += new EventHandler(chkNo_CheckedChanged); labNo[i].Checked = true; Label lab4 = new Label(); lab4.Name = "labSn" + i.ToString(); lab4.Dock = DockStyle.Fill; lab4.Margin = new Padding(0); lab4.TextAlign = ContentAlignment.MiddleCenter; lab4.Text = ""; labSn.Add(lab4); } //附加标志编号 for (int i = 0; i < _uutMax; i++) { Label lab1 = new Label(); lab1.Name = "labUUTNo" + (i + _uutMax).ToString(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(0); lab1.TextAlign = ContentAlignment.MiddleCenter; lab1.Text = (i + 1).ToString("D2"); labUUTNo.Add(lab1); } //初始化panelUUT panelUUT = new TableLayoutPanel(); panelUUT.Dock = DockStyle.Fill; panelUUT.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset; panelUUT.Margin = new Padding(5, 20, 5, 20); panelUUT.RowCount = 3; panelUUT.ColumnCount = _uutMax; panelUUT.RowStyles.Add(new RowStyle(SizeType.Absolute, 32)); panelUUT.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); panelUUT.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); for (int i = 0; i < _uutMax; i++) { panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); } for (int i = 0; i < _uutMax; i++) { panelUUT.Controls.Add(labUUTNo[i], i, 0); panelUUT.Controls.Add(labUUT[i], i, 1); panelUUT.Controls.Add(labUUTNo[i + _uutMax], i, 2); } panelUUT.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelUUT, true, null); panel4.Controls.Add(panelUUT); //初始化标题 Label labT1 = new Label(); labT1.Dock = DockStyle.Fill; labT1.Margin = new Padding(0); labT1.TextAlign = ContentAlignment.MiddleCenter; labT1.Tag = "编号"; labT1.Text = CLanguage.Lan("编号"); Label labT2 = new Label(); labT2.Dock = DockStyle.Fill; labT2.Margin = new Padding(0); labT2.TextAlign = ContentAlignment.MiddleCenter; labT2.Tag = "产品条码"; labT2.Text = CLanguage.Lan("产品条码"); //初始化panelSn panelSn = new TableLayoutPanel(); panelSn.Dock = DockStyle.Fill; panelSn.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; panelSn.Margin = new Padding(1); panelSn.RowCount = _uutMax + 1; panelSn.ColumnCount = 2; panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 40)); panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelSn.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); for (int i = 0; i < _uutMax; i++) { panelSn.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } panelSn.Controls.Add(labT1, 0, 0); panelSn.Controls.Add(labT2, 1, 0); for (int i = 0; i < _uutMax; i++) { panelSn.Controls.Add(labNo[i], 0, i + 1); panelSn.Controls.Add(labSn[i], 1, i + 1); } panelSn.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelSn, true, null); panel1.Controls.Add(panelSn, 1, 0); } catch (Exception) { throw; } }
private void treeAdjust_AfterSelect(object sender, TreeViewEventArgs e) { if (treeAdjust.SelectedNode.Index == 0) { if (dataType == DataType.DataType.TotalStation && isCalculate == false) { b = null; pnlResult.BackgroundImage = null; TraverseAdjustment traverseAdjustTable = new TraverseAdjustment(); tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); traverseAdjustTable.DrawTable(pnlResult, col0, col1, col2, col3, tableLayoutPanel);//此处col3为高程值,为预留接口 tableType = 4; } else { b = null; pnlResult.BackgroundImage = null; TraverseAdjustment traverseAdjustTable = new TraverseAdjustment(); tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); traverseAdjustTable.DrawTable(pnlResult, col0, col1, col2, col4, col5, col8, col14, col15, tableLayoutPanel);//此处col3为高程值,为预留接口 } } else if (treeAdjust.SelectedNode.Index == 1) { } else if (treeAdjust.SelectedNode.Index == 2) { if (dataType == DataType.DataType.TotalStation && isCalculate == true) { pnlResult.BackgroundImage = null; ControlPointTable controlPointTable = new ControlPointTable(); tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); controlPointTable.DrawTable(filePath, pnlResult, tableLayoutPanel, col0, col14, col15); tableType = 6; } } else if (treeAdjust.SelectedNode.Index == 3) { if (dataType == DataType.DataType.TotalStation && isCalculate == true) { pnlResult.BackgroundImage = null; ResultTable resultTable = new ResultTable(); tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); resultTable.DrawTable(filePath, pnlResult, tableLayoutPanel, col0, col14, col15, col16, col17, col18); tableType = 7; } } else if (treeAdjust.SelectedNode.Index == 4) { if (dataType == DataType.DataType.TotalStation && isCalculate == true) { pnlResult.BackgroundImage = null; AccuracyTable accuracyTable = new AccuracyTable(); tableLayoutPanel = new TableLayoutPanel(); tableLayoutPanel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel, true, null); accuracyTable.DrawTable(filePath, pnlResult, tableLayoutPanel, unitError, col0, col6, col7, col8, col9, col10, col11, col12, col13); tableType = 8; } } else if (treeAdjust.SelectedNode.Index == 5) { if (dataType == DataType.DataType.TotalStation && isCalculate == true) { pnlResult.BackgroundImage = null; DrawGraphics drawGraphic = new DrawGraphics(); b = drawGraphic.DrawPoint(pnlResult, col0, col14, col15); tableType = 9; } } else if (treeAdjust.SelectedNode.Index == 6) { if (dataType == DataType.DataType.TotalStation && isCalculate == true) { pnlResult.BackgroundImage = null; DrawGraphics drawGraphic = new DrawGraphics(); b = drawGraphic.DrawLine(pnlResult, col0, col11, col12, col13, col14, col15); tableType = 10; } } }
/// <summary> /// 加载通道界面 /// </summary> private void load_Max_UUT(int uutMax) { try { for (int i = 0; i < _uutMax; i++) { Label lab1 = new Label(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(1); lab1.TextAlign = ContentAlignment.MiddleLeft; lab1.Font = new Font("宋体", 10); lab1.Name = "labSlot" + i.ToString(); lab1.Text = "【" + CLanguage.Lan("产品条码") + (i + 1).ToString("D2") + "】:"; labNo.Add(lab1); Label lab2 = new Label(); lab2.Dock = DockStyle.Fill; lab2.Margin = new Padding(1); lab2.TextAlign = ContentAlignment.MiddleCenter; lab2.Font = new Font("宋体", 10); lab2.Name = "labSn" + i.ToString(); lab2.Text = ""; labSn.Add(lab2); Label lab3 = new Label(); lab3.Dock = DockStyle.Fill; lab3.Margin = new Padding(1); lab3.TextAlign = ContentAlignment.MiddleCenter; lab3.Font = new Font("宋体", 10); lab3.Name = "labResult" + i.ToString(); lab3.Text = ""; labResult.Add(lab3); } //初始化panelUUT panelUUT = new TableLayoutPanel(); panelUUT.Dock = DockStyle.Fill; panelUUT.Margin = new Padding(1, 3, 1, 3); panelUUT.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset; panelUUT.ColumnCount = 3; panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120)); panelUUT.RowCount = uutMax; for (int i = 0; i < uutMax; i++) { panelUUT.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } panelUUT.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelUUT, true, null); for (int i = 0; i < uutMax; i++) { panelUUT.Controls.Add(labNo[i], 0, i); panelUUT.Controls.Add(labSn[i], 1, i); panelUUT.Controls.Add(labResult[i], 2, i); } panel2.Controls.Add(panelUUT, 0, 1); } catch (Exception) { throw; } }
private void displayTempCommodity() { if (_cropList.Count > 0 && _blightList.Count > 0) { string strSelectField = "code,name"; string text = "code in ("; for (int i = 0; i < _cropList.Count; i++) { text = text + "{" + i + "},"; } text = text.Substring(0, text.Length - 1) + ")"; DataTable dataTable = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, strSelectField, "HyCrop", text, "", null, _cropList.ToArray(), CommandOperationType.ExecuteReaderReturnDataTable); Dictionary <string, string> dictionary = new Dictionary <string, string>(); for (int j = 0; j < dataTable.Rows.Count; j++) { dictionary.Add(dataTable.Rows[j]["code"].ToString(), dataTable.Rows[j]["name"].ToString()); } string strSelectField2 = "code,name"; string text2 = "code in ("; for (int k = 0; k < _blightList.Count; k++) { text2 = text2 + "{" + k + "},"; } text2 = text2.Substring(0, text2.Length - 1) + ")"; DataTable dataTable2 = (DataTable)DataBaseUtilities.DBOperation(Program.ConnectionString, TableOperation.Select, strSelectField2, "HyBlight", text2, "", null, _blightList.ToArray(), CommandOperationType.ExecuteReaderReturnDataTable); Dictionary <string, string> dictionary2 = new Dictionary <string, string>(); for (int l = 0; l < dataTable2.Rows.Count; l++) { dictionary2.Add(dataTable2.Rows[l]["code"].ToString(), dataTable2.Rows[l]["name"].ToString()); } tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(tableLayoutPanel1, true, null); tableLayoutPanel1.RowCount = _cropList.Count + 1; for (int m = 0; m < _cropList.Count; m++) { CheckBox checkBox = new CheckBox(); checkBox.AutoSize = false; checkBox.CheckAlign = ContentAlignment.MiddleCenter; checkBox.Dock = DockStyle.Fill; checkBox.Name = m.ToString(); Label label = new Label(); label.Text = dictionary[_cropList[m]]; label.AutoSize = false; label.TextAlign = ContentAlignment.MiddleCenter; label.Dock = DockStyle.Fill; label.BackColor = Color.Transparent; label.Anchor = AnchorStyles.None; Label label2 = new Label(); label2.Text = dictionary2[_blightList[m]]; label2.AutoSize = false; label2.TextAlign = ContentAlignment.MiddleCenter; label2.Dock = DockStyle.Fill; label2.BackColor = Color.Transparent; label2.Anchor = AnchorStyles.None; tableLayoutPanel1.Controls.Add(checkBox, 0, m + 1); tableLayoutPanel1.Controls.Add(label, 1, m + 1); tableLayoutPanel1.Controls.Add(label2, 2, m + 1); tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f)); } tableLayoutPanel1.Padding = new Padding(0, 0, 6, 0); } }
/// <summary> /// 加载通道界面 /// </summary> private void load_Max_UUT(int uutMax) { try { Label lab1 = new Label(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(3); lab1.Font = new Font("宋体", 10); lab1.ForeColor = Color.Black; lab1.TextAlign = ContentAlignment.MiddleCenter; lab1.Text = CLanguage.Lan("仪器槽位编号"); labTitle.Add(lab1); Label lab2 = new Label(); lab2.Dock = DockStyle.Fill; lab2.Margin = new Padding(3); lab2.Font = new Font("宋体", 10); lab2.ForeColor = Color.Black; lab2.TextAlign = ContentAlignment.MiddleCenter; lab2.Text = CLanguage.Lan("测试总数"); labTitle.Add(lab2); Label lab3 = new Label(); lab3.Dock = DockStyle.Fill; lab3.Margin = new Padding(3); lab3.Font = new Font("宋体", 10); lab3.ForeColor = Color.Black; lab3.TextAlign = ContentAlignment.MiddleCenter; lab3.Text = CLanguage.Lan("测试不良"); labTitle.Add(lab3); Label lab4 = new Label(); lab4.Dock = DockStyle.Fill; lab4.Margin = new Padding(3); lab4.Font = new Font("宋体", 10); lab4.ForeColor = Color.Black; lab4.TextAlign = ContentAlignment.MiddleCenter; lab4.Text = CLanguage.Lan("良率") + "(%)"; labTitle.Add(lab4); for (int i = 0; i < uutMax; i++) { Label lab5 = new Label(); lab5.Dock = DockStyle.Fill; lab5.Margin = new Padding(3); lab5.TextAlign = ContentAlignment.MiddleCenter; lab5.ForeColor = Color.Black; lab5.Font = new Font("宋体", 10); lab5.Name = "labSlotName" + i.ToString(); lab5.Text = "【" + CLanguage.Lan("槽位") + (i + 1).ToString("D2") + "】:"; labName.Add(lab5); Label labAteTT = new Label(); labAteTT.Dock = DockStyle.Fill; labAteTT.Margin = new Padding(3); labAteTT.TextAlign = ContentAlignment.MiddleCenter; labAteTT.ForeColor = Color.Black; labAteTT.Font = new Font("宋体", 10); labAteTT.Name = "labAteTT" + i.ToString(); labAteTT.Text = "0"; labTTNum.Add(labAteTT); Label labAteFAIL = new Label(); labAteFAIL.Dock = DockStyle.Fill; labAteFAIL.Margin = new Padding(3); labAteFAIL.TextAlign = ContentAlignment.MiddleCenter; labAteFAIL.ForeColor = Color.Red; labAteFAIL.Font = new Font("宋体", 10); labAteFAIL.Name = "labAteFAIL" + i.ToString(); labAteFAIL.Text = "0"; labFailNum.Add(labAteFAIL); Label labATEPass = new Label(); labATEPass.Dock = DockStyle.Fill; labATEPass.Margin = new Padding(3); labATEPass.TextAlign = ContentAlignment.MiddleCenter; labATEPass.ForeColor = Color.Green; labATEPass.Font = new Font("宋体", 10); labATEPass.Name = "labATEPass" + i.ToString(); labATEPass.Text = "100%"; labPassRate.Add(labATEPass); } Label labYielName = new Label(); labYielName.Dock = DockStyle.Fill; labYielName.Margin = new Padding(3); labYielName.Font = new Font("宋体", 10); labYielName.ForeColor = Color.Black; labYielName.TextAlign = ContentAlignment.MiddleCenter; labYielName.Text = CLanguage.Lan("总数统计"); labTotal.Add(labYielName); Label labSlotTTNum = new Label(); labSlotTTNum.Dock = DockStyle.Fill; labSlotTTNum.Margin = new Padding(3); labSlotTTNum.Font = new Font("宋体", 10); labSlotTTNum.ForeColor = Color.Blue; labSlotTTNum.TextAlign = ContentAlignment.MiddleCenter; labSlotTTNum.Text = "0"; labTotal.Add(labSlotTTNum); Label labSlotFailNum = new Label(); labSlotFailNum.Dock = DockStyle.Fill; labSlotFailNum.Margin = new Padding(3); labSlotFailNum.Font = new Font("宋体", 10); labSlotFailNum.ForeColor = Color.Red; labSlotFailNum.TextAlign = ContentAlignment.MiddleCenter; labSlotFailNum.Text = "0"; labTotal.Add(labSlotFailNum); Label labSlotPassRate = new Label(); labSlotPassRate.Dock = DockStyle.Fill; labSlotPassRate.Margin = new Padding(3); labSlotPassRate.Font = new Font("宋体", 10); labSlotPassRate.ForeColor = Color.Green; labSlotPassRate.TextAlign = ContentAlignment.MiddleCenter; labSlotPassRate.Text = "0"; labTotal.Add(labSlotPassRate); panelYield = new TableLayoutPanel(); panelYield.Dock = DockStyle.Fill; panelYield.Margin = new Padding(1, 3, 1, 3); panelYield.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset; panelYield.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelYield, true, null); panelYield.RowCount = uutMax + 2; panelYield.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); for (int i = 0; i < uutMax; i++) { panelYield.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } panelYield.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); panelYield.ColumnCount = 4; panelYield.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120)); for (int i = 0; i < 3; i++) { panelYield.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); } for (int i = 0; i < labTitle.Count; i++) { panelYield.Controls.Add(labTitle[i], i, 0); } for (int i = 0; i < uutMax; i++) { panelYield.Controls.Add(labName[i], 0, i + 1); panelYield.Controls.Add(labTTNum[i], 1, i + 1); panelYield.Controls.Add(labFailNum[i], 2, i + 1); panelYield.Controls.Add(labPassRate[i], 3, i + 1); } for (int i = 0; i < labTotal.Count; i++) { panelYield.Controls.Add(labTotal[i], i, uutMax + 1); } this.Controls.Add(panelYield); } catch (Exception) { throw; } }
/// <summary> /// 创建UI主框架 /// </summary> private void CreateMainFrame() { try { //加载行数标题栏 panelTilte = new TableLayoutPanel(); panelTilte.Dock = DockStyle.Fill; panelTilte.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; panelTilte.Margin = new Padding(0); panelTilte.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelTilte, true, null); panelTilte.RowCount = CGlobalPara.C_ROW_MAX; for (int i = 0; i < CGlobalPara.C_ROW_MAX; i++) { panelTilte.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } panelTilte.ColumnCount = 1; panelTilte.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50)); for (int i = 0; i < CGlobalPara.C_ROW_MAX; i++) { Label labRow = new Label(); labRow.Name = "labRowTilte" + i.ToString(); labRow.Text = "L" + (i + 1).ToString(); labRow.Dock = DockStyle.Fill; labRow.TextAlign = ContentAlignment.MiddleCenter; if (labRow.Text.Length == 2) { labRow.Font = new Font("宋体", 15); } else { labRow.Font = new Font("宋体", 12); } labRow.Margin = new Padding(0); panelTilte.Controls.Add(labRow, 0, i); } panel1.Controls.Add(panelTilte, 0, 0); //加载主界面分隔线 panelMain = new TableLayoutPanel[CGlobalPara.C_ROOM_MAX]; for (int rom = 0; rom < panelMain.Length; rom++) { panelMain[rom] = new TableLayoutPanel(); panelMain[rom].Dock = DockStyle.Fill; panelMain[rom].CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; panelMain[rom].Margin = new Padding(0); panelMain[rom].GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelMain[rom], true, null); panelMain[rom].RowCount = CGlobalPara.C_ROW_MAX * 2; for (int i = 0; i < CGlobalPara.C_ROW_MAX; i++) { panelMain[rom].RowStyles.Add(new RowStyle(SizeType.Absolute, 12)); panelMain[rom].RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } panelMain[rom].ColumnCount = CGlobalPara.C_COL_MAX; for (int i = 0; i < CGlobalPara.C_COL_MAX; i++) { panelMain[rom].ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); } panel1.Controls.Add(panelMain[rom], 1 + rom, 0); } } catch (Exception) { throw; } }
/// <summary> /// 加载16通道测试界面 /// </summary> private void load_Max_UUT16() { try { for (int i = 0; i < _uutMax; i++) { Label lab1 = new Label(); lab1.Name = "labUUTNo" + i.ToString(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(0); lab1.TextAlign = ContentAlignment.MiddleCenter; lab1.Text = (i + 1).ToString("D2"); labUUTNo.Add(lab1); Label lab2 = new Label(); lab2.Name = "labUUT" + i.ToString(); lab2.Dock = DockStyle.Fill; lab2.Margin = new Padding(0); lab2.TextAlign = ContentAlignment.MiddleCenter; lab2.Text = ""; lab2.BackColor = Color.White; lab2.ImageList = imageList1; labUUT.Add(lab2); Label lab3 = new Label(); lab3.Name = "labNo" + i.ToString(); lab3.Dock = DockStyle.Fill; lab3.Margin = new Padding(0); lab3.TextAlign = ContentAlignment.MiddleCenter; lab3.Text = (i + 1).ToString("D2"); labNo.Add(lab3); Label lab4 = new Label(); lab4.Name = "labSn" + i.ToString(); lab4.Dock = DockStyle.Fill; lab4.Margin = new Padding(0); lab4.TextAlign = ContentAlignment.MiddleCenter; lab4.Text = ""; labSn.Add(lab4); } //初始化panelUUT int N = _uutMax / 2; panelUUT = new TableLayoutPanel(); panelUUT.Dock = DockStyle.Fill; panelUUT.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset; panelUUT.Margin = new Padding(5, 25, 5, 25); panelUUT.RowCount = N; panelUUT.ColumnCount = 4; panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 28)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelUUT.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 28)); for (int i = 0; i < N; i++) { panelUUT.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } for (int i = 0; i < N; i++) { if (_fixPos == 0) { panelUUT.Controls.Add(labUUTNo[i], 0, i); panelUUT.Controls.Add(labUUT[i], 1, i); panelUUT.Controls.Add(labUUT[i + N], 2, N - i - 1); panelUUT.Controls.Add(labUUTNo[i + N], 3, N - i - 1); } else { panelUUT.Controls.Add(labUUTNo[i + N], 0, i); panelUUT.Controls.Add(labUUT[i + N], 1, i); panelUUT.Controls.Add(labUUT[N - i - 1], 2, i); panelUUT.Controls.Add(labUUTNo[N - i - 1], 3, i); } } panelUUT.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelUUT, true, null); panel4.Controls.Add(panelUUT); } catch (Exception) { throw; } }
/// <summary> /// 加载产品条码界面 /// </summary> private void load_Sn_UUT() { //初始化标题 Label labT1 = new Label(); labT1.Name = "labTitle1"; labT1.Dock = DockStyle.Fill; labT1.Margin = new Padding(0); labT1.TextAlign = ContentAlignment.MiddleCenter; labT1.Text = CLanguage.Lan("编号"); labT1.Tag = "编号"; Label labT2 = new Label(); labT2.Name = "labTitle2"; labT2.Dock = DockStyle.Fill; labT2.Margin = new Padding(0); labT2.TextAlign = ContentAlignment.MiddleCenter; labT2.Text = CLanguage.Lan("产品条码"); labT2.Tag = "产品条码"; Label labT3 = new Label(); labT3.Name = "labTitle3"; labT3.Dock = DockStyle.Fill; labT3.Margin = new Padding(0); labT3.TextAlign = ContentAlignment.MiddleCenter; labT3.Text = CLanguage.Lan("初测"); labT3.Tag = "初测"; Label labT4 = new Label(); labT4.Name = "labTitle4"; labT4.Dock = DockStyle.Fill; labT4.Margin = new Padding(0); labT4.TextAlign = ContentAlignment.MiddleCenter; labT4.Text = CLanguage.Lan("老化"); labT4.Tag = "老化"; Label labT5 = new Label(); labT5.Name = "labTitle5"; labT5.Dock = DockStyle.Fill; labT5.Margin = new Padding(0); labT5.TextAlign = ContentAlignment.MiddleCenter; labT5.Text = CLanguage.Lan("高压"); labT5.Tag = "高压"; Label labT6 = new Label(); labT6.Name = "labTitle6"; labT6.Dock = DockStyle.Fill; labT6.Margin = new Padding(0); labT6.TextAlign = ContentAlignment.MiddleCenter; labT6.Text = "ATE"; //初始化panelSn panelSn = new TableLayoutPanel(); panelSn.Dock = DockStyle.Fill; panelSn.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; panelSn.Margin = new Padding(1); panelSn.RowCount = _uutMax + 1; panelSn.ColumnCount = 6; panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 40)); panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 48)); panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 48)); panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 48)); panelSn.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 48)); panelSn.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); for (int i = 0; i < _uutMax; i++) { panelSn.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } panelSn.Controls.Add(labT1, 0, 0); panelSn.Controls.Add(labT2, 1, 0); panelSn.Controls.Add(labT3, 2, 0); panelSn.Controls.Add(labT4, 3, 0); panelSn.Controls.Add(labT5, 4, 0); panelSn.Controls.Add(labT6, 5, 0); for (int i = 0; i < _uutMax; i++) { panelSn.Controls.Add(labNo[i], 0, i + 1); panelSn.Controls.Add(labSn[i], 1, i + 1); for (int z = 0; z < _statFlowId.Count; z++) { panelSn.Controls.Add(labUIResult[z][i], 2 + z, i + 1); } } panelSn.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelSn, true, null); panel1.Controls.Add(panelSn, 1, 0); }
/// <summary> /// 绑定控件 /// </summary> private void IntialControl() { int temp_Max = 15; int col_num = 5; int row_num = 3; panelTemp = new TableLayoutPanel(); panelTemp.Dock = DockStyle.Fill; panelTemp.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; panelTemp.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(panelTemp, true, null); panelTemp.RowCount = row_num; panelTemp.ColumnCount = col_num * 2; for (int i = 0; i < row_num; i++) { panelTemp.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); } for (int i = 0; i < col_num * 2; i++) { panelTemp.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); } this.Controls.Add(panelTemp); labNo.Clear(); labT.Clear(); for (int col = 0; col < col_num; col++) { for (int row = 0; row < row_num; row++) { int idNo = col * row_num + row; if (idNo < temp_Max) { Label lab1 = new Label(); lab1.Name = "labNo" + idNo.ToString(); lab1.Dock = DockStyle.Fill; lab1.Margin = new Padding(0); lab1.Font = new Font("宋体", 10); lab1.TextAlign = ContentAlignment.MiddleCenter; lab1.Text = CLanguage.Lan("温度") + (idNo + 1).ToString("D2") + ":"; Label lab2 = new Label(); lab2.Name = "labT" + idNo.ToString(); lab2.Dock = DockStyle.Fill; lab2.Margin = new Padding(0); lab2.TextAlign = ContentAlignment.MiddleCenter; lab2.BorderStyle = BorderStyle.Fixed3D; lab2.Font = new Font("宋体", 12, FontStyle.Bold); lab2.BackColor = Color.Black; lab2.ForeColor = Color.Cyan; labNo.Add(lab1); labT.Add(lab2); panelTemp.Controls.Add(labNo[idNo], 0 + col * 2, row); panelTemp.Controls.Add(labT[idNo], 1 + col * 2, row); } } } }
private void Form1_Load(object sender, EventArgs e) { table.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .SetValue(table, true, null); tablePrint(); }