コード例 #1
0
        private void AddGamesButton_Click(object sender, EventArgs e)
        {
            GamesForm newGames = new GamesForm("");

            if (newGames.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                BlueVex2.Properties.Settings.Default.Games.Add(newGames.GameName + "," + newGames.GamePW);
                PopulateGamesListView();
            }
        }
コード例 #2
0
 private void EditGamesButton_Click(object sender, EventArgs e)
 {
     if (this.GamesListView.SelectedItems.Count > 0)
     {
         string    itemString = this.GamesListView.SelectedItems[0].Text + "," + this.GamesListView.SelectedItems[0].SubItems[1].Text;
         GamesForm newGames   = new GamesForm(itemString);
         if (newGames.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             BlueVex2.Properties.Settings.Default.Games.Remove(itemString);
             BlueVex2.Properties.Settings.Default.Games.Add(newGames.GameName + "," + newGames.GamePW);
             PopulateGamesListView();
         }
     }
 }
コード例 #3
0
        private void btnGames_Click(object sender, EventArgs e)
        {
            FormCollection fc        = Application.OpenForms;
            bool           foundForm = false;

            foreach (Form frm in fc)
            {
                if (frm is GamesForm)
                {
                    foundForm = true;
                    frm.BringToFront();
                    break;
                }
            }
            if (!foundForm)
            {
                GamesForm gamesForm = new GamesForm();
                gamesForm.Show();
            }
        }