コード例 #1
0
        //Start Main Form
        private void button1_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            //Create a new instance of the mnForm form
            if (mainform == null || mainform.Text == "")
            {
                mainform = new MainFrm();
                mainform.Show();
                this.Hide();
            }
            else if (CheckOpened(mainform.Text))
            {
                mainform.WindowState = FormWindowState.Normal;
                mainform.Focus();
            }
            else
            {
                MessageBox.Show("ERROR - Can't open Main Form");
            }

            mainform       = null;
            Cursor.Current = Cursors.Arrow;
        }