Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String name         = textBox1.Text;
            Form1  A            = new Form1();
            Form2  B            = new Form2();
            Form3  C            = new Form3();
            Random random       = new Random();
            int    randomnumber = random.Next(0, 2);


            string GenderGuess = (randomnumber == 1) ? "You're a man aren't you," + name + "?" : "You're a woman aren't you," + name + "?";

            MessageBox.Show(GenderGuess);

            A.Close();

            if (randomnumber == 1)
            {
                B.Show(this);
            }

            else
            {
                C.Show(this);
            }
        }
Пример #2
0
 private void ClusterController_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (e.CloseReason != CloseReason.FormOwnerClosing)
     {
         main.Close();
     }
 }
Пример #3
0
        private void button6_Click(object sender, EventArgs e)  //应力在线保存预览
        {
            this.backgroundWorker1.RunWorkerAsync();
            Form1 form = new Form1(this.backgroundWorker1);

            form.ShowDialog(this);
            form.Close();
        }
Пример #4
0
        private void no_Click(object sender, EventArgs e)
        {//If No button is clicked
            this.Hide();
            f1.Hide();
            Form f3 = new Form3(); //Create an object for Form 3

            f3.ShowDialog();       //Display the form 3     Lines after this are useless in this event
            f1.Close();
            this.Close();
        }
        private void Main_Tool_Load(object sender, EventArgs e)
        {
            if (richTextBox1.Find("3.56") > 0)
            {
                richTextBox1.SelectionFont  = new Font("Verdana", 12, FontStyle.Bold);
                richTextBox1.SelectionColor = Color.Red;
            }
            this.Size = new Size(362, 156);
            Main_Tool main = new Main_Tool();
            Form1     frm1 = new Form1();

            frm1.Close();
        }