You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -135,7 +135,7 @@ This code uses the keyword `foreach` in C# or `For Each` in Visual Basic.
135
135
136
136
The icons are visible now because you haven't hidden them. To hide them from the player, you can set each label's **ForeColor** property to the same color as its **BackColor** property.
137
137
138
-
1. Stop the program. Remove the comment marks for the commented line of code inside the loop.
138
+
1. Stop the program. Remove the comment marks for the commented line of code inside the loop in the `AssignIconsToSquares()` method
@@ -50,7 +50,7 @@ They keep track of, or refer to Label objects.
50
50
These statements don't cause Label controls to appear on the form because there's no `new` keyword.
51
51
When the program starts, both `firstClicked` and `secondClicked` are set to `null` for C# or `Nothing` for Visual Basic.
52
52
53
-
2. Modify your <xref:System.Windows.Forms.Control.Click> event handler to use the new `firstClicked` reference variable.
53
+
2. Modify your <xref:System.Windows.Forms.Control.Click> event handler in `Form1.cs` or `Form1.vb`to use the new `firstClicked` reference variable.
54
54
Remove the last statement in the `label1_Click()` event handler method (`clickedLabel.ForeColor = Color.Black;`) and replace it with the `if` statement as follows.
55
55
56
56
### [C#](#tab/csharp)
@@ -94,7 +94,7 @@ If the icons don't match, it hides the two icons again after a short period of t
94
94
Your program calls the <xref:System.Windows.Forms.Timer.Start> method to start the timer after the player chooses the second label.
95
95
96
96
4. Choose the timer control icon and then press **Enter**, or double-click the timer.
97
-
The IDE adds an empty Tick event handler.
97
+
The IDE adds an empty Tick event handler to `Form1.cs` or `Form1.vb`.
98
98
Replace the code with the following code.
99
99
100
100
### [C#](#tab/csharp)
@@ -109,7 +109,7 @@ If the icons don't match, it hides the two icons again after a short period of t
109
109
- It uses two reference variables, `firstClicked` and `secondClicked`, to make the icons of the two labels that the player chose invisible again.
110
110
- It resets the `firstClicked` and `secondClicked` reference variables to `null` in C# and `Nothing` in Visual Basic.
111
111
112
-
5. Go to the code editor and add code to the top and bottom of the `label1_Click()` event handler method.
112
+
5. Go to the code editor and add code to the top and bottom of the `label1_Click()` event handler method in `Form1.cs` or `Form1.vb`.
113
113
This code will check if the timer is enabled, set the `secondClicked` reference variable, and start the timer.
114
114
The `label1_Click()` event handler method now looks as follows:
0 commit comments