private void InitControls() { this.SuspendLayout(); //挂起布局 //机箱的ComboBox var cntNames = FuncItemsForm.GetInstance().GetEqSetNames(Princeple.FormType.SYSTEM); _cntCB.Items.AddRange(cntNames); //构件的ComboBox var cmpNames = FuncItemsForm.GetInstance().GetEqSetNames(Princeple.FormType.COMPONENT); _cmpCB.Items.AddRange(cmpNames); //初始化listView _appLv.View = View.Details; _appLv.GridLines = true; _appLv.FullRowSelect = true; _appLv.Columns.Add("序号", 70, HorizontalAlignment.Center); _appLv.Columns.Add(new ColumnHeader() { Text = "应用类型", TextAlign = HorizontalAlignment.Center }); //_appLv.Columns[1].Width = _appLv.ClientSize.Width - _appLv.Columns[0].Width; _appLv.Columns[1].Width = _appLv.Width - _appLv.Columns[0].Width; this.ResumeLayout(); //实施布局 }
//点击菜单,显示功能区子窗体 private void FuncToolStripMenuItem_Click(object sender, EventArgs e) { FuncItemsForm fItemsWnd = FuncItemsForm.GetInstance(); ToolStripMenuItem item = (ToolStripMenuItem)sender; item.Checked = !item.Checked; if (item.Checked) { fItemsWnd.Show(dockPanel1, DockState.DockLeft); } else { fItemsWnd.Hide(); } }
private void MainForm_Load(object sender, EventArgs e) { //显示FuncItem FuncItemsForm fItemsWnd = FuncItemsForm.GetInstance(); fItemsWnd.Show(dockPanel1, DockState.DockLeft); //显示Property PropertyForm propertyWnd = PropertyForm.GetInstance(); propertyWnd.Show(dockPanel1, DockState.DockRight); //显示OutPutForm OutPutForm outPutForm = OutPutForm.GetInstacne(); outPutForm.Show(dockPanel1, DockState.DockBottom); }
//初始化机箱集对应的DataGridview private void InitContainersDgv() { //初始化DataGridView的基本属性 _consDgv.RowHeadersVisible = false; _consDgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; _consDgv.AllowUserToAddRows = false; _consDgv.EditMode = DataGridViewEditMode.EditOnEnter; _consDgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect; //添加列 _consDgv.ColumnCount = 1; _consDgv.Columns[0].Name = "机箱号"; //添加板卡名 DataGridViewComboBoxColumn comboColumn = new DataGridViewComboBoxColumn(); comboColumn.Name = "机箱名"; comboColumn.DataSource = FuncItemsForm.GetInstance().GetEqSetNames(Princeple.FormType.CONTIANER); _consDgv.Columns.Add(comboColumn); }
private void ListDataGridView() { //初始化DataGridView的基本属性 dataGridView1.RowHeadersVisible = false; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridView1.AllowUserToAddRows = false; dataGridView1.EditMode = DataGridViewEditMode.EditOnEnter; dataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect; //添加列 dataGridView1.ColumnCount = 1; dataGridView1.Columns[0].Name = "槽位号"; //添加板卡名 DataGridViewComboBoxColumn comboColumn = new DataGridViewComboBoxColumn(); comboColumn.Name = "板卡名"; comboColumn.DataSource = FuncItemsForm.GetInstance().GetEqSetNames(Princeple.FormType.BOARD); dataGridView1.Columns.Add(comboColumn); }
//类型选择框内容改变响应 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { comboBox2.Items.Clear(); switch (comboBox1.Text) { case "PPC": string[] ppcChipNode = FuncItemsForm.GetInstance().GetEqSetNames(Princeple.FormType.PPC);; ComboBox2_AddItems(ppcChipNode); break; case "FPGA": string[] fpgaChipNode = FuncItemsForm.GetInstance().GetEqSetNames(Princeple.FormType.FPGA);; ComboBox2_AddItems(fpgaChipNode); break; case "ZYNQ": string[] zynqChipNode = FuncItemsForm.GetInstance().GetEqSetNames(Princeple.FormType.ZYNQ);; ComboBox2_AddItems(zynqChipNode); break; default: break; } }
private void BpTypeComboBoxInit() { var names = FuncItemsForm.GetInstance().GetEqSetNames(Princeple.FormType.BACKPLANE); _bpTypeCB.Items.AddRange(names); }