private void Init() { string[] tmpstr = model.settings.DevOrder.ToString().Split(','); //model.DevNumber = tmpstr.Length; ViewManage = new CViewManage(panelDockContainer2); //bar1.Text = "联系电话:13849176996"; pictureBox1.Top = 585;//logo图标位置 devlist = new CDevListview[model.DevNumber]; pictureBox2.ImageLocation = ".\\img\\photonull.bmp"; pictureBox3.ImageLocation = ".\\img\\photonull.bmp"; for (int i = 0; i < model.DevNumber; i++) { devlist[i] = new CDevListview(panelDockContainer2, Convert.ToInt16(tmpstr[i])); ViewManage.AddControl(devlist[i]); comboBox1.Items.Add(tmpstr[i]); devlist[i].Menu_clear += new CDevListview.MenuEventHandler(Main_Form_Menu_clear); devlist[i].Menu_del += new CDevListview.MenuEventHandler(Main_Form_Menu_del); devlist[i].Menu_showstu += new CDevListview.MenuEventHandler(Main_Form_Menu_showstu); } ViewManage.AutoMove();//自动排列设备LISTVIEW if ((devlist[model.DevNumber - 1].Left + devlist[model.DevNumber - 1].Width + groupPanel_gridview.Width) < panelDockContainer2.Width) { groupPanel_gridview.Left = devlist[model.DevNumber - 1].Left + devlist[model.DevNumber - 1].Width + 3; groupPanel_gridview.Top = devlist[model.DevNumber - 1].Top; groupPanel_gridview.Height = devlist[model.DevNumber - 1].Height; groupPanel_gridview.Width = devlist[model.DevNumber - 1].Width * 2; } else { groupPanel_gridview.Left = 3; groupPanel_gridview.Top = devlist[model.DevNumber - 1].Top + devlist[model.DevNumber - 1].Height + 5; groupPanel_gridview.Height = devlist[model.DevNumber - 1].Height; groupPanel_gridview.Width = devlist[model.DevNumber - 1].Width * 2; } OracleLinkStatus.ImageLocation = "img/red2.gif"; comboBox1.Text = model.devmanager.GetMinnum().ToString(); buttonX1.Enabled = false; }
public void RemoveControl(CDevListview con) { ControlList.Remove(con); }
public void AddControl(CDevListview con) { ControlList.Add(con); }