/// <summary>
 /// Clean up any resources being used.
 /// </summary>
 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing && (components != null))
     {
         if (SecondForm != null)
         {
             SecondForm.Close();
         }
         FavoriteWriter();
         components.Dispose();
     }
     base.Dispose(disposing);
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            SecondForm form = new SecondForm(textBox1.Text);

            form.UserName = textBox1.Text;
            if (DialogResult.OK == form.ShowDialog())
            {
            }                                             //ShowDialog invokes the modal form
            textBox1.Text = form.UserName;
            if (form != null)
            {
                form.Close();
            }
            form          = new SecondForm();
            form.UserName = textBox1.Text;
            form.Visible  = true;
            form.Show(this);
        }