private void MainInterface_Load(object sender, EventArgs e) { Properties.Settings.Default.LogPath = Application.StartupPath; emergency_serialport = new SerialPort("COM26", 9600); smrtjnc_serialport = new SerialPort("COM10", 2000000); normaljnc_serialport = new SerialPort("COM3", 2000000); emergency_serialport.Open(); smrtjnc_serialport.Open(); normaljnc_serialport.Open(); Junction smrtjnc_mstr = new Junction("SMRTJNC", smrtjnc_serialport); Junction normal_junction = new Junction("normal_junction", normaljnc_serialport); smrtjnc_mstr.TopLevel = false; normal_junction.TopLevel = false; Junctions.Add(normal_junction); Junctions.Add(smrtjnc_mstr); normal_junction.Dock = DockStyle.Left; smrtjnc_mstr.Dock = DockStyle.Right; smrtjnc_mstr.Show(); normal_junction.Show(); foreach (Junction junction in Junctions) { junction.TopLevel = false; JunctionViewContainer.Controls.Add(junction); junction.Show(); } }