Skip to content

Commit 4aa6fed

Browse files
authored
Merge pull request #3926 from MicrosoftDocs/master637039911365909775
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 71a6992 + 6c55c40 commit 4aa6fed

11 files changed

+133
-59
lines changed
3.28 KB
Loading

docs/get-started/csharp/tutorial-aspnet-core-ef-step-01.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Note that for most of the project templates you can also choose to enable Docker
8282
- Work or School Accounts. This option uses Active Directory, Azure AD, or Office 365 for authentication.
8383
- Windows Authentication. Suitable for intranet applications.
8484

85-
Select the standard Web Application template with No Authentication and click **OK**.
85+
Select the standard Web Application template with No Authentication and click **Create**.
8686

8787
![Visual Studio 2019 Choose ASP.NET Core Project Options](media/vs-2019/vs2019-choose-aspnetcore-project.png)
8888

docs/ide/step-1-create-a-project-and-add-labels-to-your-form.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
22
title: "Step 1: Create a project and add labels to your form"
33
ms.date: 05/31/2019
4-
ms.topic: conceptual
4+
ms.topic: tutorial
55
ms.prod: visual-studio-windows
66
ms.technology: vs-ide-general
77
ms.assetid: f44e50be-a5f5-4d77-9cff-dd52374c3f74
8+
ms.devlang:
9+
- "csharp"
10+
- "vb"
811
author: TerryGLee
912
ms.author: tglee
1013
manager: jillfra
@@ -16,7 +19,7 @@ ms.workload:
1619
As the first steps in developing this quiz, you create the project, and you add labels, a button, and other controls to a form. You also set properties for each control that you add. The project will contain the form, the controls, and (later in the tutorial) code. The button starts the quiz, the labels show the quiz problems, and the other controls show the quiz answers and the time that remains to finish the quiz.
1720

1821
> [!NOTE]
19-
> This topic is part of a tutorial series about basic coding concepts. For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md).
22+
> This topic is part of a tutorial series about basic coding concepts. <br><li>For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md). <br><li>To download a completed version of the code, see [Complete math quiz tutorial sample](https://code.msdn.microsoft.com/Complete-Math-Quiz-8581813c).
2023
2124
## To create a project for a form
2225

@@ -96,7 +99,7 @@ As the first steps in developing this quiz, you create the project, and you add
9699

97100
7. Choose the plus sign (**+**) next to the **Font** property, and then change the value of the **Size** property to **15.75**.
98101

99-
You can change several font properties, as the following picture shows.
102+
You can change several font properties, as the following screenshot shows.
100103

101104
![Properties window showing font size](../ide/media/express_setfontsize.png)
102105

@@ -144,7 +147,7 @@ As the first steps in developing this quiz, you create the project, and you add
144147

145148
16. Change the value of the **(Name)** property for the NumericUpDown control to **sum**.
146149

147-
You've created the first row, as the following picture shows.
150+
You've created the first row, as shown in the following illustration.
148151

149152
![First row of math quiz](../ide/media/express_firstrow.png)
150153

@@ -194,14 +197,14 @@ As the first steps in developing this quiz, you create the project, and you add
194197
195198
7. Set the value of the **TabIndex** property for the NumericUpDown sum control to **2**, for the difference control to **3**, for the product control to **4**, and for the quotient control to **5**.
196199

197-
The form should look like the following illustration.
200+
The form should look similar to the following screenshot.
198201

199202
![Initial math quiz form](../ide/media/express_formlaidout.png)
200203

201204
8. To verify whether the **TabIndex** property works as you expect, save and run your program by choosing the **F5** key, or by choosing **Debug** > **Start Debugging** on the menu bar, and then choose the **Tab** key a few times.
202205

203206
## To continue or review
204207

205-
- To go to the next tutorial step, see [Step 2: Create a random addition problem](../ide/step-2-create-a-random-addition-problem.md).
208+
- To go to the next tutorial step, see **[Step 2: Create a random addition problem](../ide/step-2-create-a-random-addition-problem.md)**.
206209

207210
- To return to the overview topic, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md).

docs/ide/step-2-create-a-random-addition-problem.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
---
22
title: "Step 2: Create a random addition problem"
33
ms.date: 11/04/2016
4-
ms.topic: conceptual
5-
dev_langs:
4+
ms.topic: tutorial
5+
ms.prod: visual-studio-windows
6+
ms.technology: vs-ide-general
7+
ms.devlang:
8+
- "csharp"
9+
- "vb"
10+
dev_langs:
611
- "csharp"
712
- "vb"
813
ms.assetid: 6461c4cf-f2aa-4bf5-91ed-06820a4f893d
@@ -16,7 +21,7 @@ ms.workload:
1621
In the second part of this tutorial, you make the quiz challenging by adding math problems that are based on random numbers. You also create a method that's named `StartTheQuiz()` and that fills in the problems and starts the countdown timer. Later in this tutorial, you'll add the subtraction, multiplication, and division problems.
1722

1823
> [!NOTE]
19-
> This topic is part of a tutorial series about basic coding concepts. For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md).
24+
> This topic is part of a tutorial series about basic coding concepts. <br><li>For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md). <br><li>To download a completed version of the code, see [Complete math quiz tutorial sample](https://code.msdn.microsoft.com/Complete-Math-Quiz-8581813c).
2025
2126
## To create a random addition problem
2227

@@ -31,6 +36,9 @@ In the second part of this tutorial, you make the quiz challenging by adding mat
3136
[!code-csharp[VbExpressTutorial3Step2#1](../ide/codesnippet/CSharp/step-2-create-a-random-addition-problem_1.cs)]
3237
[!code-vb[VbExpressTutorial3Step2#1](../ide/codesnippet/VisualBasic/step-2-create-a-random-addition-problem_1.vb)]
3338

39+
> [!IMPORTANT]
40+
> Use the programming language control at the top right of this page to view either the C# code snippet or the Visual Basic code snippet.<br><br>![Programming language control for Docs.Microsoft.com](../ide/media/docs-programming-language-control.png)
41+
3442
You've added a Random object to your form and named the object **randomizer**.
3543

3644
`Random` is known as an object. You've probably heard that word before, and you learn more about what it means for programming in the next tutorial. For now, just remember that you can use `new` statements to create buttons, labels, panels, OpenFileDialogs, ColorDialogs, SoundPlayers, Randoms, and even forms, and those items are referred to as objects. When you run your program, the form is started, and the code behind it creates a random object and names it **randomizer**.
@@ -54,8 +62,8 @@ In the second part of this tutorial, you make the quiz challenging by adding mat
5462

5563
Notice that when you enter the dot (.) after `randomizer` in the code, an IntelliSense window opens and shows you all of the Random object's methods that you can call. For example, IntelliSense lists the `Next()` method, as follows.
5664

57-
![Next method](../ide/media/express_randomwhite.png)
58-
Next method
65+
![Next method](../ide/media/express_randomwhite.png)<br/>
66+
*Next method*
5967

6068
When you enter a dot after an object, IntelliSense shows a list of the object's members, such as properties, methods, and events.
6169

@@ -82,15 +90,15 @@ Next method
8290

8391
8. Save your code, run it, and then choose the **Start** button.
8492

85-
A random addition problem appears, as the following illustration shows.
93+
A random addition problem appears, as shown in the following screenshot.
8694

87-
![Random addition problem](../ide/media/express_additionproblem.png)
88-
Random addition problem
95+
![Random addition problem](../ide/media/express_additionproblem.png)<br/>
96+
*Random addition problem*
8997

9098
In the next step of the tutorial, you'll add the sum.
9199

92100
## To continue or review
93101

94-
- To go to the next tutorial step, see [Step 3: Add a countdown timer](../ide/step-3-add-a-countdown-timer.md).
102+
- To go to the next tutorial step, see **[Step 3: Add a countdown timer](../ide/step-3-add-a-countdown-timer.md)**.
95103

96104
- To return to the previous tutorial step, see [Step 1: Create a project and add labels to your form](../ide/step-1-create-a-project-and-add-labels-to-your-form.md).

docs/ide/step-3-add-a-countdown-timer.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
---
22
title: "Step 3: Add a countdown timer"
33
ms.date: 11/04/2016
4-
ms.topic: conceptual
5-
dev_langs:
4+
ms.topic: tutorial
5+
ms.prod: visual-studio-windows
6+
ms.technology: vs-ide-general
7+
ms.devlang:
8+
- "csharp"
9+
- "vb"
10+
dev_langs:
611
- "csharp"
712
- "vb"
813
ms.assetid: 62670a2b-efdc-45c6-9646-9b17eeb33dcb
@@ -16,7 +21,7 @@ ms.workload:
1621
In the third part of this tutorial, you'll add a countdown timer to track the number of seconds that remain for the quiz taker to finish.
1722

1823
> [!NOTE]
19-
> This topic is part of a tutorial series about basic coding concepts. For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md).
24+
> This topic is part of a tutorial series about basic coding concepts. <br><li>For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md). <br><li>To download a completed version of the code, see [Complete math quiz tutorial sample](https://code.msdn.microsoft.com/Complete-Math-Quiz-8581813c).
2025
2126
## To add a countdown timer
2227

@@ -25,6 +30,9 @@ In the third part of this tutorial, you'll add a countdown timer to track the nu
2530
[!code-vb[VbExpressTutorial3Step3#5](../ide/codesnippet/VisualBasic/step-3-add-a-countdown-timer_1.vb)]
2631
[!code-csharp[VbExpressTutorial3Step3#5](../ide/codesnippet/CSharp/step-3-add-a-countdown-timer_1.cs)]
2732

33+
> [!IMPORTANT]
34+
> Use the programming language control at the top right of this page to view either the C# code snippet or the Visual Basic code snippet.<br><br>![Programming language control for Docs.Microsoft.com](../ide/media/docs-programming-language-control.png)
35+
2836
Now you need a method that actually counts the seconds, such as a timer, which raises an event after the amount of time that you specify.
2937

3038
2. In the design window, move a <xref:System.Windows.Forms.Timer> control from the **Components** category of the **Toolbox** to your form.
@@ -51,7 +59,7 @@ In the third part of this tutorial, you'll add a countdown timer to track the nu
5159
You just added an `if else` statement, which is how you tell programs to make decisions. An `if else` statement looks like the following.
5260

5361
> [!NOTE]
54-
> The following example is for illustration only-don't add it to your project.
62+
> The following example is for demonstration only--don't add it to your project.
5563
5664
```vb
5765
If (something that your program will check) Then
@@ -96,11 +104,11 @@ In the third part of this tutorial, you'll add a countdown timer to track the nu
96104

97105
The timer starts to count down. When time runs out, the quiz ends, and the answer appears. The following illustration shows the quiz in progress.
98106

99-
![Math quiz in progress](../ide/media/express_addcountdown.png)
100-
Math quiz in progress
107+
![Math quiz in progress](../ide/media/express_addcountdown.png)<br/>
108+
*Math quiz in progress*
101109

102110
## To continue or review
103111

104-
- To go to the next tutorial step, see [Step 4: Add the CheckTheAnswer() method](../ide/step-4-add-the-checktheanswer-parens-method.md).
112+
- To go to the next tutorial step, see **[Step 4: Add the CheckTheAnswer() method](../ide/step-4-add-the-checktheanswer-parens-method.md)**.
105113

106114
- To return to the previous tutorial step, see [Step 2: Create a random addition problem](../ide/step-2-create-a-random-addition-problem.md).

docs/ide/step-4-add-the-checktheanswer-parens-method.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
---
22
title: "Step 4: Add the CheckTheAnswer() method"
33
ms.date: 11/04/2016
4-
ms.topic: conceptual
5-
dev_langs:
4+
ms.topic: tutorial
5+
ms.prod: visual-studio-windows
6+
ms.technology: vs-ide-general
7+
ms.devlang:
8+
- "csharp"
9+
- "vb"
10+
dev_langs:
611
- "csharp"
712
- "vb"
813
ms.assetid: c66f3831-b4a0-40bc-a109-8f46f4db35ed
@@ -16,17 +21,23 @@ ms.workload:
1621
In the fourth part of this tutorial, you'll write a method, `CheckTheAnswer()`, that determines whether the answers to the math problems are correct. This topic is part of a tutorial series about basic coding concepts. For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md).
1722

1823
> [!NOTE]
19-
> If you're following along in Visual Basic, you'll use the `Function` keyword instead of the usual `Sub` keyword because this method returns a value. It's really that simple: a sub doesn't return a value, but a function does.
24+
> This topic is part of a tutorial series about basic coding concepts. <br><li>For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md). <br><li>To download a completed version of the code, see [Complete math quiz tutorial sample](https://code.msdn.microsoft.com/Complete-Math-Quiz-8581813c).
2025
2126
## To verify whether the answers are correct
2227

28+
> [!NOTE]
29+
> If you're following along in Visual Basic, you'll use the `Function` keyword instead of the usual `Sub` keyword because this method returns a value. It's really that simple: a sub doesn't return a value, but a function does.
30+
2331
1. Add the `CheckTheAnswer()` method.
2432

2533
When this method is called, it adds the values of addend1 and addend2 and compares the result to the value in the sum <xref:System.Windows.Forms.NumericUpDown> control. If the values are equal, the method returns a value of `true`. Otherwise, the method returns a value of `false`. Your code should look like the following.
2634

2735
[!code-vb[VbExpressTutorial3Step4#8](../ide/codesnippet/VisualBasic/step-4-add-the-checktheanswer-parens-method_1.vb)]
2836
[!code-csharp[VbExpressTutorial3Step4#8](../ide/codesnippet/CSharp/step-4-add-the-checktheanswer-parens-method_1.cs)]
2937

38+
> [!IMPORTANT]
39+
> Use the programming language control at the top right of this page to view either the C# code snippet or the Visual Basic code snippet.<br><br>![Programming language control for Docs.Microsoft.com](../ide/media/docs-programming-language-control.png)
40+
3041
Next, you'll check the answer by updating the code in the method for the timer's <xref:System.Windows.Forms.Timer.Tick> event handler to call the new `CheckTheAnswer()` method.
3142

3243
2. Add the following code to the `if else` statement.
@@ -45,6 +56,6 @@ In the fourth part of this tutorial, you'll write a method, `CheckTheAnswer()`,
4556

4657
## To continue or review
4758

48-
- To go to the next tutorial step, see [Step 5: Add Enter event handlers for the NumericUpDown controls](../ide/step-5-add-enter-event-handlers-for-the-numericupdown-controls.md).
59+
- To go to the next tutorial step, see **[Step 5: Add Enter event handlers for the NumericUpDown controls](../ide/step-5-add-enter-event-handlers-for-the-numericupdown-controls.md)**.
4960

5061
- To return to the previous tutorial step, see [Step 3: Add a countdown timer](../ide/step-3-add-a-countdown-timer.md).

docs/ide/step-5-add-enter-event-handlers-for-the-numericupdown-controls.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
---
22
title: "Step 5: Add Enter event handlers for NumericUpDown controls"
33
ms.date: 11/04/2016
4-
ms.topic: conceptual
4+
ms.topic: tutorial
5+
ms.prod: visual-studio-windows
6+
ms.technology: vs-ide-general
7+
ms.devlang:
8+
- "csharp"
9+
- "vb"
10+
dev_langs:
11+
- "csharp"
12+
- "vb"
513
ms.assetid: 45a99a5d-c881-4298-b74d-adb481dec5ee
614
author: TerryGLee
715
ms.author: tglee
@@ -17,7 +25,7 @@ ms.workload:
1725
In the fifth part of this tutorial, you'll add <xref:System.Windows.Forms.Control.Enter> event handlers to make entering answers for quiz problems a little easier. This code will select and clear the current value in each <xref:System.Windows.Forms.NumericUpDown> control as soon as the quiz taker chooses it and starts to enter a different value.
1826

1927
> [!NOTE]
20-
> This topic is part of a tutorial series about basic coding concepts. For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md).
28+
> This topic is part of a tutorial series about basic coding concepts. <br><li>For an overview of the tutorial, see [Tutorial 2: Create a timed math quiz](../ide/tutorial-2-create-a-timed-math-quiz.md). <br><li>To download a completed version of the code, see [Complete math quiz tutorial sample](https://code.msdn.microsoft.com/Complete-Math-Quiz-8581813c).
2129
2230
## To verify the default behavior
2331

@@ -52,6 +60,9 @@ In the fifth part of this tutorial, you'll add <xref:System.Windows.Forms.Contro
5260
[!code-vb[VbExpressTutorial3Step5_6#11](../ide/codesnippet/VisualBasic/step-5-add-enter-event-handlers-for-the-numericupdown-controls_1.vb)]
5361
[!code-csharp[VbExpressTutorial3Step5_6#11](../ide/codesnippet/CSharp/step-5-add-enter-event-handlers-for-the-numericupdown-controls_1.cs)]
5462

63+
> [!IMPORTANT]
64+
> Use the programming language control at the top right of this page to view either the C# code snippet or the Visual Basic code snippet.<br><br>![Programming language control for Docs.Microsoft.com](../ide/media/docs-programming-language-control.png)
65+
5566
This code may look complex, but you can understand it if you look at it step by step. First, look at the top of the method: `object sender` in C# or `sender As System.Object` in Visual Basic. 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. So, in the first line of the method, you specify that the sender isn't just any generic object but specifically a NumericUpDown control. (Every NumericUpDown control is an object, but not every object is a NumericUpDown control.) The NumericUpDown control is named **answerBox** in this method, because it will be used for all of the NumericUpDown controls on the form, not just the sum NumericUpDown control. Because you declare the answerBox variable in this method, its scope applies only to this method. In other words, the variable can be used only within this method.
5667

5768
The next line verifies whether answerBox was successfully converted (cast) from an object to a NumericUpDown control. If the conversion was unsuccessful, the variable would have a value of `null` (C#) or `Nothing` (Visual Basic). The third line gets the length of the answer that appears in the NumericUpDown control, and the fourth line selects the current value in the control based on this length. Now, when the quiz taker chooses the control, Visual Studio fires this event, which causes the current answer to be selected. As soon as the quiz taker starts to enter a different answer, the previous answer is cleared and replaced with the new answer.
@@ -68,6 +79,6 @@ In the fifth part of this tutorial, you'll add <xref:System.Windows.Forms.Contro
6879

6980
## To continue or review
7081

71-
- To go to the next tutorial step, see [Step 6: Add a subtraction problem](../ide/step-6-add-a-subtraction-problem.md).
82+
- To go to the next tutorial step, see **[Step 6: Add a subtraction problem](../ide/step-6-add-a-subtraction-problem.md)**.
7283

7384
- To return to the previous tutorial step, see [Step 4: Add the CheckTheAnswer() method](../ide/step-4-add-the-checktheanswer-parens-method.md).

0 commit comments

Comments
 (0)