private void AddCalculatorControl(
     fsCakeFormationBaseControl calculatorControl,
     params string [] moduleNames)
 {
     foreach (string moduleName in moduleNames)
     {
         comboBox1.Items.Add(moduleName);
         m_moduleNameToControl.Add(moduleName, calculatorControl);
     }
     comboBox1.SelectedItem = comboBox1.Items[0];
 }
        private void ChangeAndShowCurrentCalculatorControl()
        {
            fsCakeFormationBaseControl lastCalculatorControl = m_currentCalculatorControl;

            foreach (var keyValue in m_moduleNameToControl)
            {
                if (keyValue.Key == comboBox1.Text)
                {
                    m_currentCalculatorControl = keyValue.Value;
                    break;
                }
            }

            if (m_currentCalculatorControl != null)
            {
                m_currentCalculatorControl.Parent = panel1;
                m_currentCalculatorControl.Dock   = DockStyle.Fill;

                if (lastCalculatorControl != null)
                {
                    m_currentCalculatorControl.SetCalculationOptionAndRefreshCalculatorControl(lastCalculatorControl.GetCalculationOption());
                    m_currentCalculatorControl.SetMaterialParametersTableVisible(lastCalculatorControl.GetMaterialParametersTableVisible());
                    m_currentCalculatorControl.SetValuesAndRefreshCalculatorControl(lastCalculatorControl.GetValues());

                    Control owningControl = m_currentCalculatorControl.ControlToResizeForExpanding;
                    m_currentCalculatorControl.ControlToResizeForExpanding = null;
                    m_currentCalculatorControl.SetDiagramVisible(lastCalculatorControl.GetDiagramVisible());
                    m_currentCalculatorControl.ControlToResizeForExpanding = owningControl;
                }
            }

            foreach (fsCakeFormationBaseControl calculatorControl in m_moduleNameToControl.Values)
            {
                if (calculatorControl != m_currentCalculatorControl)
                {
                    calculatorControl.Parent = null;
                }
            }
        }