public HeadBoardPortSetting(ArrayList supportHeadList, HEAD_BOARD_TYPE headBoardType) { InitializeComponent(); //switch (headBoardType) //{ // //此处应该根据头板类型动态生成布局 //} headNumPerHb = PubFunc.GetHeadNumPerHeadborad(headBoardType); m_SupportHeadList = supportHeadList; portComboBoxs = new List <ComboBox>() { comboBoxHead8, comboBoxHead4, comboBoxHead7, comboBoxHead3, comboBoxHead6, comboBoxHead2, comboBoxHead5, comboBoxHead1, }; for (int i = 0; i < portComboBoxs.Count; i++) { portComboBoxs[i].Items.Clear(); for (int j = 0; j < m_SupportHeadList.Count; j++) { string cmode = ((VenderDisp)m_SupportHeadList[j]).DisplayName; portComboBoxs[i].Items.Add(cmode); } } }