Skip to content

Commit df356a0

Browse files
Merge pull request #13244 from anandmeg/uuf-248532
Updates for UUF item
2 parents d8d88d5 + 65b2111 commit df356a0

6 files changed

+6
-18
lines changed

docs/get-started/csharp/tutorial-windows-forms-match-game-icons.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ It stores the randomly chosen symbols.
5959
:::code language="vb" source="../../snippets/visualbasic/VS_Snippets_VBCSharp/vbexpresstutorial4step2_3_4/vb/form1.vb" id="Snippet1":::
6060
---
6161

62-
[!INCLUDE [devlang-control-csharp-vb](../includes/devlang-control-csharp-vb.md)]
63-
6462
If you're using C#, be sure you put the code after the opening curly brace and just after the class declaration (`public partial class Form1 : Form`). If you're using Visual Basic, put the code right after the class declaration (`Public Class Form1`).
6563

6664
You can use list objects to keep track of different types of items.

docs/get-started/csharp/tutorial-windows-forms-match-game-labels.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ They keep track of, or refer to Label objects.
4747
:::code language="vb" source="../../snippets/visualbasic/VS_Snippets_VBCSharp/vbexpresstutorial4step5/vb/form1.vb" id="Snippet5":::
4848
---
4949

50-
[!INCLUDE [devlang-control-csharp-vb](../includes/devlang-control-csharp-vb.md)]
51-
5250
These statements don't cause Label controls to appear on the form because there's no `new` keyword.
5351
When the program starts, both `firstClicked` and `secondClicked` are set to `null` for C# or `Nothing` for Visual Basic.
5452

docs/get-started/csharp/tutorial-windows-forms-match-game-play.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ Those labels continue to be displayed.
4848
:::code language="vb" source="../../snippets/visualbasic/VS_Snippets_VBCSharp/vbexpresstutorial4step7/vb/form1.vb" id="Snippet9":::
4949
---
5050

51-
[!INCLUDE [devlang-control-csharp-vb](../includes/devlang-control-csharp-vb.md)]
52-
5351
The `if` statement checks whether the icon in the first label that the player chooses is the same as the icon in the second label.
5452
If the icons are the same, the program runs its three statements.
5553
The first two statements reset the `firstClicked` and `secondClicked` reference variables.

docs/get-started/csharp/tutorial-windows-forms-math-quiz-add-math-problems.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.custom: vs-acquisition
55
dev_langs:
66
- "CSharp"
77
- "VB"
8-
ms.date: 03/15/2023
8+
ms.date: 10/18/2024
99
ms.topic: tutorial
1010
author: anandmeg
1111
ms.author: meghaanand
@@ -37,7 +37,7 @@ This tutorial builds on a previous tutorial, [Create a math quiz WinForms app](t
3737

3838
1. On the menu bar, select **View** > **Code**. *Form1.cs* or *Form1.vb* appears, depending on the programming language that you're using, so that you can view the code behind the form.
3939

40-
1. Create a <xref:System.Random> object by adding a `new` statement near the top of the code.
40+
1. Create a <xref:System.Random> object by adding a `new` statement near the top of the code in *Form1.cs* or *Form1.vb*.
4141

4242
### [C#](#tab/csharp)
4343
:::code language="csharp" source="../../snippets/csharp/VS_Snippets_VBCSharp/vbexpresstutorial3step2/cs/form1.cs" id="Snippet1":::
@@ -46,15 +46,13 @@ This tutorial builds on a previous tutorial, [Create a math quiz WinForms app](t
4646
:::code language="vb" source="../../snippets/visualbasic/VS_Snippets_VBCSharp/vbexpresstutorial3step2/vb/form1.vb" id="Snippet1":::
4747
---
4848

49-
[!INCLUDE [devlang-control-csharp-vb](../includes/devlang-control-csharp-vb.md)]
50-
5149
You can use `new` statements like this one to create buttons, labels, panels, OpenFileDialogs, ColorDialogs, SoundPlayers, Randoms, and even forms. These items are called *objects*.
5250

5351
When you run your program, the form is started. The code behind it creates a Random object and names it **randomizer**.
5452

5553
Your quiz needs variables to store the random numbers that it creates for each problem. Before using variables, you declare them, which means listing their names and data types.
5654

57-
1. Add two integer variables to the form, and name them **addend1** and **addend2**.
55+
1. Add two integer variables to the form, and name them **addend1** and **addend2** in *Form1.cs* or *Form1.vb*.
5856

5957
> [!NOTE]
6058
> An integer variable is known as an *int* in C# or an *Integer* in Visual Basic. This kind of variable stores a positive or negative number from -2147483648 through 2147483647 and can store only whole numbers, not decimals.
@@ -68,7 +66,7 @@ This tutorial builds on a previous tutorial, [Create a math quiz WinForms app](t
6866
:::code language="vb" source="../../snippets/visualbasic/VS_Snippets_VBCSharp/vbexpresstutorial3step2/vb/form1.vb" id="Snippet2":::
6967
---
7068

71-
1. Add a method that's named `StartTheQuiz()`. This method uses the Random object's <xref:System.Random.Next> method to generate random numbers for the labels. `StartTheQuiz()` will eventually fill in all the problems and then start the timer, so add this information to the summary comment. The function should look like the following code.
69+
1. Add a method that's named `StartTheQuiz()` *Form1.cs* or *Form1.vb*. This method uses the Random object's <xref:System.Random.Next> method to generate random numbers for the labels. `StartTheQuiz()` will eventually fill in all the problems and then start the timer, so add this information to the summary comment. The function should look like the following code.
7270

7371
### [C#](#tab/csharp)
7472
:::code language="csharp" source="../../snippets/csharp/VS_Snippets_VBCSharp/vbexpresstutorial3step2/cs/form1.cs" id="Snippet3":::
@@ -94,7 +92,7 @@ This tutorial builds on a previous tutorial, [Create a math quiz WinForms app](t
9492

9593
The next step is to declare variables and provide random values for the other math problems.
9694

97-
1. Add integer variables for the remaining math problems to your form, after the addition problem variables. The code should look like the following sample.
95+
1. Add integer variables for the remaining math problems to your form, after the addition problem variables. The code in *Form1.cs* or *Form1.vb* should look like the following sample.
9896

9997
### [C#](#tab/csharp)
10098
:::code language="csharp" source="../../snippets/csharp/VS_Snippets_VBCSharp/vbexpresstutorial3step7/cs/form1.cs" range="14-38":::
@@ -103,7 +101,7 @@ The next step is to declare variables and provide random values for the other ma
103101
:::code language="vb" source="../../snippets/visualbasic/VS_Snippets_VBCSharp/vbexpresstutorial3step7/vb/form1.vb" range="2-27":::
104102
---
105103

106-
1. Modify the `StartTheQuiz()` method by adding the following code, starting with the "Fill in the subtraction problem" comment.
104+
1. Modify the `StartTheQuiz()` method in *Form1.cs* or *Form1.vb* by adding the following code, starting with the "Fill in the subtraction problem" comment.
107105

108106
### [C#](#tab/csharp)
109107
:::code language="csharp" source="../../snippets/csharp/VS_Snippets_VBCSharp/vbexpresstutorial3step7/cs/form1.cs" range="51-94":::

docs/get-started/csharp/tutorial-windows-forms-math-quiz-add-timer.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ To keep track of time during the quiz, you use a timer component. You also need
4242
:::code language="vb" source="../../snippets/visualbasic/VS_Snippets_VBCSharp/vbexpresstutorial3step7/vb/form1.vb" id="Snippet15":::
4343
---
4444

45-
[!INCLUDE [devlang-control-csharp-vb](../includes/devlang-control-csharp-vb.md)]
46-
4745
2. In **Windows Forms Designer**, move a <xref:System.Windows.Forms.Timer> control from the **Components** category of the **Toolbox** to your form. The control appears in the gray area at the bottom of the design window.
4846

4947
3. On the form, select the **timer1** icon that you just added, and set its **Interval** property to **1000**. Because this interval is in milliseconds, a value of 1000 causes the timer to raise a <xref:System.Windows.Forms.Timer.Tick> event every second.

docs/get-started/csharp/tutorial-windows-forms-math-quiz-customize-ui.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ The quiz contains <xref:System.Windows.Forms.NumericUpDown> controls that quiz t
5353
:::code language="vb" source="../../snippets/visualbasic/VS_Snippets_VBCSharp/vbexpresstutorial3step5_6/vb/form1.vb" id="Snippet11":::
5454
---
5555

56-
[!INCLUDE [devlang-control-csharp-vb](../includes/devlang-control-csharp-vb.md)]
57-
5856
In this code:
5957

6058
- The first line declares the method. It includes a parameter that's named `sender`. In C#, the parameter is `object sender`. In Visual Basic, it's `sender As System.Object`. This parameter refers to the object whose event is firing, which is known as the sender. In this case, the sender object is the NumericUpDown control.

0 commit comments

Comments
 (0)