Skip to content

Commit 214b215

Browse files
authored
Merge pull request #1704 from TerryGLee/tglee-vsmetapatch
change get-started-article metadata to either conceptual or tutorial
2 parents 63e5724 + 1937061 commit 214b215

3 files changed

+108
-108
lines changed

docs/cross-platform/getting-started-with-visual-studio-tools-for-unity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.reviewer: ""
66
ms.suite: ""
77
ms.technology: vs-unity-tools
88
ms.tgt_pltfrm: ""
9-
ms.topic: "get-started-article"
9+
ms.topic: "conceptual"
1010
ms.assetid: 66b5b4eb-13b5-4071-98d2-87fafa4598a8
1111
author: "conceptdev"
1212
ms.author: "crdun"

docs/ide/getting-started-with-cpp-in-visual-studio.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ ms.custom: "mvc"
44
ms.date: "12/04/2017"
55
ms.technology: "vs-acquisition"
66
ms.tgt_pltfrm: ""
7-
ms.topic: "get-started-article"
7+
ms.topic: "tutorial"
88
author: "corob-msft"
99
ms.author: "tglee"
1010
manager: ghogen
11-
dev_langs:
11+
dev_langs:
1212
- "CPP"
13-
ms.workload:
13+
ms.workload:
1414
- "cplusplus"
1515
---
1616
# Get Started with C++ in Visual Studio

docs/ide/walkthrough-create-a-simple-application-with-visual-csharp-or-visual-basic.md

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -6,120 +6,120 @@ ms.reviewer: ""
66
ms.suite: ""
77
ms.technology: "vs-acquisition"
88
ms.tgt_pltfrm: ""
9-
ms.topic: "get-started-article"
10-
dev_langs:
9+
ms.topic: "conceptual"
10+
dev_langs:
1111
- "VB"
1212
- "CSharp"
1313
ms.assetid: f84339c7-d617-4f56-bfcd-af2215c347ba
1414
caps.latest.revision: 19
1515
author: "TerryGLee"
1616
ms.author: "tglee"
1717
manager: ghogen
18-
ms.workload:
18+
ms.workload:
1919
- "dotnet"
2020
---
2121
# Walkthrough: Create a Simple Application with C# or Visual Basic
2222
By completing this walkthrough, you'll become familiar with many of the tools, dialog boxes, and designers that you can use when you develop applications with Visual Studio. You'll create a simple "Hello, World" application, design the UI, add code, and debug errors, while you learn about working in the integrated development environment (IDE).
23-
23+
2424
## <a name="BKMK_ConfigureIDE"></a> Configure the IDE
2525
When you start Visual Studio for the first time, you'll be prompted to sign in. This step is optional for this walkthrough. Next you may be shown a dialog box that asks you to choose your development settings and color theme. Keep the defaults and choose **Start Visual Studio**.
2626

2727
![Choose settings dialog box](../ide/media/exploreide-settings.png "exploreide-settings")
28-
28+
2929
After Visual Studio launches, you'll see tool windows, the menus and toolbars, and the main window space. Tool windows are docked on the left and right sides of the application window, with **Quick Launch**, the menu bar, and the standard toolbar at the top. In the center of the application window is the **Start Page**. When you load a solution or project, editors and designers appear in the space where the **Start Page** is. When you develop an application, you'll spend most of your time in this central area.
30-
30+
3131
![IDE with General Settings Applied](../ide/media/exploreide-idewithgeneralsettings.png "ExploreIDE-IDEwithgeneralsettings")
32-
32+
3333
## <a name="BKMK_CreateApp"></a> Create a simple application
34-
34+
3535
### Create the project
3636
When you create an application in Visual Studio, you first create a project and a solution. For this example, you'll create a Windows Presentation Foundation (WPF) project.
37-
37+
3838
#### To create the WPF project
39-
39+
4040
1. Create a new project. On the menu bar, choose **File**, **New**, **Project...**.
41-
41+
4242
![On the menu bar, choose File, New, Project](../ide/media/exploreide-filenewproject.png "ExploreIDE-FileNewProject")
43-
43+
4444
2. Choose the Visual Basic or the Visual C# WPF App template by choosing in the left pane **Installed**, **Visual C#**, **Windows Classic Desktop**, for example, and then choosing **WPF App (.NET Framework)** in the middle pane. Name the project HelloWPFApp at the bottom of the New Project dialog.
45-
45+
4646
![Create a C# WPF Project, HelloWPFApp](../ide/media/exploreide-newprojectcsharp.png "ExploreIDE-NewProjectcsharp")
47-
47+
4848
Visual Studio creates the HelloWPFApp project and solution, and **Solution Explorer** shows the various files. The WPF Designer shows a design view and a XAML view of MainWindow.xaml in a split view. You can slide the splitter to show more or less of either view. You can choose to see only the visual view or only the XAML view. (For more information, see [WPF Designer for Windows Forms Developers](http://msdn.microsoft.com/47ad0909-e89b-4996-b4ac-874d929f94ca).) The following items appear in **Solution Explorer**:
49-
49+
5050
![Solution Explorer with HelloWPFApp files loaded](../ide/media/exploreide-hellowpfappfiles.png "ExploreIDE-HelloWPFAppFiles")
51-
51+
5252
After you create the project, you can customize it. By using the **Properties** window (found on the **View** menu), you can display and change options for project items, controls, and other items in an application.
53-
53+
5454
#### To change the name of MainWindow.xaml
5555
Let's give MainWindow a more specific name.
5656

5757
1. In **Solution Explorer**, select MainWindow.xaml. You should see the **Properties** window, but if you don't, choose the **View** menu and then the **Properties Window** item.
5858
2. Change the **File Name** property to `Greetings.xaml`.
59-
59+
6060
![Properties window with File Name highlighted](../ide/media/exploreide-filenameinpropertieswindow.png "ExploreIDE-FilenameinPropertiesWindow")
61-
61+
6262
**Solution Explorer** shows that the name of the file is now Greetings.xaml, and the nested code file is now named Greetings.xaml.vb or Greetings.xaml.cs. This code file is nested under the .xaml file node to show they are closely related to each other.
63-
63+
6464
### Design the user interface (UI)
6565
We will add three types of controls to this application: a TextBlock control, two RadioButton controls, and a Button control.
66-
66+
6767
#### To add a TextBlock control
68-
68+
6969
1. Open the **Toolbox** window by choosing the **View** menu and the **Toolbox** item.
70-
70+
7171
2. In the **Toolbox**, expand the **Common WPF Controls** node to see the TextBlock control.
72-
72+
7373
![Toolbox with the TextBlock control highlighted](../ide/media/exploreide-textblocktoolbox.png "ExploreIDE-TextBlockToolbox")
74-
74+
7575
3. Add a TextBlock control to the design surface by choosing the **TextBlock** item and dragging it to the window on the design surface. Center the control near the top of the window.
76-
76+
7777
Your window should resemble the following illustration:
78-
78+
7979
![TextBlock control on the Greetings form](../ide/media/exploreide-greetingswithtextblockonly.png "ExploreIDE-GreetingswithTextblockonly")
80-
80+
8181
The XAML markup should look something like the following:
82-
82+
8383
```xaml
8484
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" RenderTransformOrigin="4.08,2.312" Margin="237,57,221,238"><Run Text="TextBlock"/><InlineUIContainer><TextBlock TextWrapping="Wrap" Text="TextBlock"/>
8585
```
8686

8787
#### To customize the text in the text block
88-
88+
8989
1. In the XAML view, locate the markup for TextBlock and change the Text attribute:
9090

9191
```xaml
9292
Text="Select a message option and then choose the Display button."
9393
```
94-
94+
9595
2. Re-center the TextBlock if necessary, and save your changes by pressing **Ctrl-s** or using the **File** menu item.
96-
96+
9797
Next, you'll add two [RadioButton](/dotnet/framework/wpf/controls/radiobutton) controls to the form.
98-
98+
9999
#### To add radio buttons
100-
100+
101101
1. In the **Toolbox**, find the **RadioButton** control.
102-
102+
103103
![Toolbox window with RadioButton control selected](../ide/media/exploreide-radiobuttontoolbox.png "ExploreIDE-RadioButtonToolbox")
104-
104+
105105
2. Add two RadioButton controls to the design surface by choosing the **RadioButton** item and dragging it to the window on the design surface. Move the buttons (by selecting them and using the arrow keys) so that the buttons appear side by side under the TextBlock control.
106-
106+
107107
Your window should look like this:
108-
108+
109109
![Greetings form with textblock and two radiobuttons](../ide/media/exploreide-greetingswithradiobuttons.png "ExploreIDE-Greetingswithradiobuttons")
110-
110+
111111
3. In the **Properties** window for the left RadioButton control, change the **Name** property (the property at the top of the **Properties** window) to **HelloButton**.
112112

113113
![RadioButton properties window](../ide/media/exploreide-buttonproperties.png "exploreide-buttonproperties")
114-
114+
115115
4. In the **Properties** window for the right RadioButton control, change the **Name** property to **GoodbyeButton**, and then save your changes.
116-
116+
117117
You can now add display text for each RadioButton control. The following procedure updates the **Content** property for a RadioButton control.
118-
118+
119119
#### To add display text for each radio button
120-
120+
121121
1. On the design surface, open the shortcut menu for HelloButton by pressing the right mouse button on HelloButton, choose **Edit Text**, and then enter 'Hello'.
122-
122+
123123
2. Open the shortcut menu for GoodbyeButton by pressing the right mouse button on GoodbyeButton, choose **Edit Text**, and then enter 'Goodbye'.
124124

125125
### To set a radio button to be checked by default
@@ -132,49 +132,49 @@ IsChecked="True"
132132
```
133133

134134
The final UI element that you'll add is a [Button](/dotnet/framework/wpf/controls/button) control.
135-
135+
136136
#### To add the button control
137-
137+
138138
1. In the **Toolbox**, find the **Button** control, and then add it to the design surface under the RadioButton controls by dragging it to the form in the design view.
139-
139+
140140
2. In the XAML view, change the value of **Content** for the Button control from `Content="Button"` to `Content="Display"`, and then save the changes.
141-
141+
142142
The markup should resemble the following example:
143143
`<Button Content="Display" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="215,204,0,0"/>`
144-
144+
145145
Your window should resemble the following illustration.
146-
146+
147147
![Greetings form with control labels](../ide/media/exploreide-greetingswithconrollabels.png "ExploreIDE-Greetingswithconrollabels")
148-
148+
149149
### Add code to the Display Button
150150
When this application runs, a message box appears after a user chooses a radio button and then chooses the **Display** button. One message box will appear for Hello, and another will appear for Goodbye. To create this behavior, you'll add code to the Button_Click event in Greetings.xaml.vb or Greetings.xaml.cs.
151-
151+
152152
#### Add code to display message boxes
153153
1. On the design surface, double-click the **Display** button.
154-
155-
Greetings.xaml.vb or Greetings.xaml.cs opens, with the cursor in the Button_Click event.
156-
154+
155+
Greetings.xaml.vb or Greetings.xaml.cs opens, with the cursor in the Button_Click event.
156+
157157
```vb
158158
Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
159-
159+
160160
End Sub
161161
```
162162
```csharp
163163
private void Button_Click_1(object sender, RoutedEventArgs e)
164164
{
165-
165+
166166
}
167167
```
168-
168+
169169
2. Enter the following code:
170-
170+
171171
```vb
172172
If HelloButton.IsChecked = True Then
173173
MessageBox.Show("Hello.")
174-
ElseIf GoodbyeButton.IsChecked = True Then
174+
ElseIf GoodbyeButton.IsChecked = True Then
175175
MessageBox.Show("Goodbye.")
176176
End If
177-
177+
178178
```
179179
```csharp
180180
if (HelloButton.IsChecked == true)
@@ -186,94 +186,94 @@ When this application runs, a message box appears after a user chooses a radio b
186186
MessageBox.Show("Goodbye.");
187187
}
188188
```
189-
189+
190190
3. Save the application.
191-
191+
192192
## <a name="BKMK_DebugTest"></a> Debug and test the application
193193
Next, you'll debug the application to look for errors and test that both message boxes appear correctly. The following instructions tell you how to build and launch the debugger, but later you might read [Building a WPF Application (WPF)](/dotnet/framework/wpf/app-development/building-a-wpf-application-wpf) and [Debugging WPF](../debugger/debugging-wpf.md) for more information.
194-
194+
195195
### Find and fix errors
196196
In this step, you'll find the error that we caused earlier by changing the name of the MainWindow.xaml file.
197-
197+
198198
#### To start debugging and find the error
199-
199+
200200
1. Start the debugger by selecting **Debug**, then **Start Debugging**.
201-
201+
202202
![Start Debugging command on the Debug menu](../ide/media/exploreide-startdebugging.png "ExploreIDE-StartDebugging")
203-
203+
204204
A **Break Mode** window appears, and the **Output** window indicates that an IOException has occurred: Cannot locate resource 'mainwindow.xaml'.
205-
205+
206206
2. Stop the debugger by choosing **Debug**, **Stop Debugging**.
207-
207+
208208
![Stop Debugging command on the Debug menu](../ide/media/exploreide-stopdebugging.png "ExploreIDE-StopDebugging")
209-
209+
210210
We renamed MainWindow.xaml to Greetings.xaml at the start of this walkthrough, but the code still refers to mainwindow.xaml as the startup URI for the application, so the project can't start.
211-
211+
212212
#### To specify Greetings.xaml as the startup URI
213-
213+
214214
1. In **Solution Explorer**, open the App.xaml file (in the C# project) or the Application.xaml file (in the Visual Basic project).
215-
215+
216216
2. Change `StartupUri="MainWindow.xaml"` to `StartupUri="Greetings.xaml"`, and then save the changes.
217-
217+
218218
Start the debugger again (press **F5**). You should see the Greetings window of the application. Now close the application window to stop debugging.
219-
219+
220220
### To debug with breakpoints
221221
You can test the code during debugging by adding some breakpoints. You can add breakpoints by choosing **Debug**, **Toggle Breakpoint**, by clicking in the left margin of the editor next to the line of code where you want the break to occur, or by pressing **F9**.
222-
222+
223223
#### To add breakpoints
224-
224+
225225
1. Open Greetings.xaml.vb or Greetings.xaml.cs, and select the following line: `MessageBox.Show("Hello.")`
226-
226+
227227
2. Add a breakpoint from the menu by selecting **Debug**, then **Toggle Breakpoint**.
228-
228+
229229
![Toggle Breakpoint command on the Debug menu](../ide/media/exploreide-togglebreakpoint.png "ExploreIDE-ToggleBreakpoint")
230-
230+
231231
A red circle appears next to the line of code in the far left margin of the editor window.
232-
232+
233233
3. Select the following line: `MessageBox.Show("Goodbye.")`.
234-
234+
235235
4. Press the **F9** key to add a breakpoint, and then press **F5** to start debugging.
236-
236+
237237
5. In the **Greetings** window, choose the **Hello** radio button, and then choose the **Display** button.
238-
238+
239239
The line `MessageBox.Show("Hello.")` is highlighted in yellow. At the bottom of the IDE, the Autos, Locals, and Watch windows are docked together on the left side, and the Call Stack, Breakpoints, Command, Immediate, and Output windows are docked together on the right side.
240-
240+
241241
6. On the menu bar, choose **Debug**, **Step Out**.
242-
242+
243243
The application resumes execution, and a message box with the word "Hello" appears.
244-
244+
245245
7. Choose the **OK** button on the message box to close it.
246-
246+
247247
8. In the **Greetings** window, choose the **Goodbye** radio button, and then choose the **Display** button.
248-
248+
249249
The line `MessageBox.Show("Goodbye.")` is highlighted in yellow.
250-
250+
251251
9. Choose the **F5** key to continue debugging. When the message box appears, choose the **OK** button on the message box to close it.
252-
252+
253253
10. Close the application window to stop debugging.
254-
254+
255255
11. On the menu bar, choose **Debug**, **Disable All Breakpoints**.
256-
256+
257257
### Build a release version of the application
258258
Now that you've verified that everything works, you can prepare a release build of the application.
259-
259+
260260
#### To clean the solution files and build a release version
261-
261+
262262
1. On the main menu, select **Build**, **Clean solution** to delete intermediate files and output files that were created during previous builds. This is not necessary, but it cleans up the debug build outputs.
263-
263+
264264
![The Clean Solution command on the Build menu](../ide/media/exploreide-cleansolution.png "ExploreIDE-CleanSolution")
265-
265+
266266
2. Change the build configuration for HelloWPFApp from **Debug** to **Release** by using the dropdown control on the toolbar (it says "Debug" currently).
267-
267+
268268
![The Standard toolbar with Release selected](../ide/media/exploreide-releaseversion.png "ExploreIDE-ReleaseVersion")
269-
269+
270270
3. Build the solution by choosing **Build**, then **Build Solution**.
271-
271+
272272
![Build Solution command on the Build menu](../ide/media/exploreide-buildsolution.png "ExploreIDE-BuildSolution")
273-
273+
274274
Congratulations on completing this walkthrough! You can find the .exe you built under your solution and project directory (...\HelloWPFApp\HelloWPFApp\bin\Release\\). If you want to explore more examples, see [Visual Studio Samples](../ide/visual-studio-samples.md).
275-
275+
276276
## See also
277277
[What's New in Visual Studio 2017](../ide/whats-new-in-visual-studio.md)
278278
[Get Started Developing with Visual Studio](../ide/get-started-developing-with-visual-studio.md)
279-
[Productivity Tips](../ide/productivity-tips-for-visual-studio.md)
279+
[Productivity Tips](../ide/productivity-tips-for-visual-studio.md)

0 commit comments

Comments
 (0)