From 07519ff00116902a2f38bd87f330edf2613ff641 Mon Sep 17 00:00:00 2001 From: bionic85 <144353436+bionic85@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:23:51 +0100 Subject: [PATCH] gefixt knoppen dingen --- PuzzlePlayer/PuzzlePlayer.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PuzzlePlayer/PuzzlePlayer.cs b/PuzzlePlayer/PuzzlePlayer.cs index 49fb09a..a1a65a3 100644 --- a/PuzzlePlayer/PuzzlePlayer.cs +++ b/PuzzlePlayer/PuzzlePlayer.cs @@ -26,6 +26,7 @@ namespace PuzzlePlayer_Namespace private void SetUpPuzzleForms() { + puzzleForms.Clear(); puzzleForms.Add(new PuzzleForm(new Binary())); puzzleForms.Add(new PuzzleForm(new Maze())); } @@ -106,6 +107,7 @@ namespace PuzzlePlayer_Namespace Image = Image.FromFile(image + ".jpg"), FlatStyle = FlatStyle.Flat, Font = SettingForm.mainFont, + Name = i.ToString() }; button.MouseEnter += (object o, EventArgs e) => @@ -121,7 +123,9 @@ namespace PuzzlePlayer_Namespace button.MouseClick += (object o, MouseEventArgs e) => { this.Hide(); - PuzzleForm puzzleForm = new PuzzleForm(new Binary()); + RoundedButton rb = (RoundedButton) o; + + PuzzleForm puzzleForm = puzzleForms[int.Parse(rb.Name)]; puzzleForm.FormClosed += (object o, FormClosedEventArgs fcea) => { this.BackColor = SettingForm.primaryColor; @@ -135,6 +139,7 @@ namespace PuzzlePlayer_Namespace this.Show(); }; puzzleForm.Show(); + SetUpPuzzleForms(); //cheeky dwdw }; buttonsPanel.Controls.Add(button); // -- buttons.Add(button); -- GitLab