Skip to content

Commit 13220a3

Browse files
committed
replace devlang control text with include file
1 parent 0f5e0dd commit 13220a3

10 files changed

+11
-20
lines changed

docs/ide/step-10-write-code-for-additional-buttons-and-a-check-box.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ This code adds functionality to the buttons you added earlier. Without this code
2626
## How to write code for additional buttons and a check box
2727

2828
Add the following code to your **Form1** code file (*Form1.cs* or *Form1.vb*).
29-
> [!IMPORTANT]
30-
> 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)
29+
30+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
3131

3232
[!code-csharp[VbExpressTutorial1Step9_10#2](../ide/codesnippet/CSharp/step-10-write-code-for-additional-buttons-and-a-check-box_1.cs)]
3333

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ In the second part of this tutorial, you make the quiz challenging by adding mat
3636
[!code-csharp[VbExpressTutorial3Step2#1](../ide/codesnippet/CSharp/step-2-create-a-random-addition-problem_1.cs)]
3737
[!code-vb[VbExpressTutorial3Step2#1](../ide/codesnippet/VisualBasic/step-2-create-a-random-addition-problem_1.vb)]
3838

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)
39+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
4140

4241
You've added a Random object to your form and named the object **randomizer**.
4342

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ In the third part of this tutorial, you'll add a countdown timer to track the nu
3030
[!code-vb[VbExpressTutorial3Step3#5](../ide/codesnippet/VisualBasic/step-3-add-a-countdown-timer_1.vb)]
3131
[!code-csharp[VbExpressTutorial3Step3#5](../ide/codesnippet/CSharp/step-3-add-a-countdown-timer_1.cs)]
3232

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)
33+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
3534

3635
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.
3736

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ In the fourth part of this tutorial, you'll write a method, `CheckTheAnswer()`,
3535
[!code-vb[VbExpressTutorial3Step4#8](../ide/codesnippet/VisualBasic/step-4-add-the-checktheanswer-parens-method_1.vb)]
3636
[!code-csharp[VbExpressTutorial3Step4#8](../ide/codesnippet/CSharp/step-4-add-the-checktheanswer-parens-method_1.cs)]
3737

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)
38+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
4039

4140
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.
4241

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ In the fifth part of this tutorial, you'll add <xref:System.Windows.Forms.Contro
5656
[!code-vb[VbExpressTutorial3Step5_6#11](../ide/codesnippet/VisualBasic/step-5-add-enter-event-handlers-for-the-numericupdown-controls_1.vb)]
5757
[!code-csharp[VbExpressTutorial3Step5_6#11](../ide/codesnippet/CSharp/step-5-add-enter-event-handlers-for-the-numericupdown-controls_1.cs)]
5858

59-
> [!IMPORTANT]
60-
> 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)
59+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
6160

6261
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.
6362

docs/ide/step-6-add-a-subtraction-problem.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ In the sixth part of this tutorial, you'll add a subtraction problem and learn h
3737
[!code-vb[VbExpressTutorial3Step5_6#12](../ide/codesnippet/VisualBasic/step-6-add-a-subtraction-problem_1.vb)]
3838
[!code-csharp[VbExpressTutorial3Step5_6#12](../ide/codesnippet/CSharp/step-6-add-a-subtraction-problem_1.cs)]
3939

40-
> [!IMPORTANT]
41-
> 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+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
4241

4342
The names of the new integer variables—**minuend** and **subtrahend**—aren't programming terms. They're the traditional names in arithmetic for the number that's being subtracted (the subtrahend) and the number from which the subtrahend is being subtracted (the minuend). The difference is the minuend minus the subtrahend. You could use other names, because your program doesn't require specific names for variables, controls, components, or methods. You must follow rules such as not starting names with digits, but you can generally use names such as x1, x2, x3, and x4. However, generic names make code difficult to read and problems nearly impossible to track down. To keep variable names unique and helpful, you'll use the traditional names for multiplication (multiplicand × multiplier = product) and division (dividend ÷ divisor = quotient) later in this tutorial.
4443

docs/ide/step-7-add-multiplication-and-division-problems.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ In the seventh part of this tutorial, you'll add multiplication and division pro
3030
[!code-vb[VbExpressTutorial3Step7#15](../ide/codesnippet/VisualBasic/step-7-add-multiplication-and-division-problems_1.vb)]
3131
[!code-csharp[VbExpressTutorial3Step7#15](../ide/codesnippet/CSharp/step-7-add-multiplication-and-division-problems_1.cs)]
3232

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)
33+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
3534

3635
2. As you did before, modify the `StartTheQuiz()` method to fill in random numbers for the multiplication and division problems.
3736

docs/ide/step-8-customize-the-quiz.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ In the last part of the tutorial, you'll explore some ways to customize the quiz
3535
timeLabel.BackColor = Color.Red
3636
```
3737

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)
38+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
4039

4140
Reset the color when the quiz is over.
4241

docs/ide/step-8-write-code-for-the-show-a-picture-button-event-handler.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ Next, you use IntelliSense to enter more code to open an **Open File** dialog bo
8787
8888
1. Now add one more line of code. You can type it (or copy and paste it), but consider using IntelliSense to add it. The more familiar you are with IntelliSense, the more quickly you can write your own code. Your final `showButton_Click()` method should look similar to the following code.
8989

90-
> [!IMPORTANT]
91-
> 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)
90+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
9291

9392
[!code-csharp[VbExpressTutorial1Step8#1](../ide/codesnippet/CSharp/step-8-write-code-for-the-show-a-picture-button-event-handler_1.cs)]
9493

docs/ide/step-9-review-comment-and-test-your-code.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ You just built something that works, and although it's not done yet, it can alre
4848

4949
1. Add the following comment to your code.
5050

51-
> [!IMPORTANT]
52-
> 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)
51+
[!INCLUDE [devlang-control-csharp-vb](./includes/devlang-control-csharp-vb.md)]
5352

5453
[!code-csharp[VbExpressTutorial1Step9_10#1](../ide/codesnippet/CSharp/step-9-review-comment-and-test-your-code_1.cs)]
5554

0 commit comments

Comments
 (0)