Exemplo n.º 1
0
        private void buttonPlayersMain_Click(object sender, EventArgs e)
        {
            if (PublicVariables.GetDefaultSeason == null)
            {
                MessageBox.Show("Select a Season first.");
                return;
            }

            // check to see if the form is open
            if ((Application.OpenForms["FormPlayers"] as FormPlayers) != null)
            {
                // if it is then select the right form
                foreach (Form form in Application.OpenForms)
                {
                    if (form.Name == "FormPlayers")
                    {
                        // activate it
                        form.Activate();
                        if (form.WindowState == FormWindowState.Minimized)
                        {
                            form.WindowState = FormWindowState.Normal;
                        }
                    }
                }
            }
            else
            {
                // otherwise create a new instance of the form and show it
                FormPlayers formPlayers = new FormPlayers();
                formPlayers.Show();
            }
        }
Exemplo n.º 2
0
 private void buttonPlayersMain_Click(object sender, EventArgs e)
 {
     // So I cant open multiple of the same form
     formPlayers = new FormPlayers();
     formPlayers.ShowDialog();
 }