예제 #1
0
        private void DisplayButton_OpenRegistrationForm(object sender, MouseEventArgs e)
        {
            bool error = true;

            try
            {
                ClearTextFields();
                DisplayForm      displayForRef    = this;
                RegistrationForm registrationForm = new RegistrationForm(ref displayForRef);
                registrationForm.ShowDialog();
                error = false;
            }
            catch (Exception expMsg)
            {
                MessageBox.Show("application run into an error" + expMsg.Message);
            }
            finally
            {
                if (error)
                {
                    this.Close();
                }
            }
        }
예제 #2
0
 /// <summary>
 /// constructor: to invoke InitializerComponent funciton
 /// </summary>
 public RegistrationForm(ref DisplayForm displayForm)
 {
     InitializeComponent();
     displayFromRef = displayForm;
 }