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
# CA2225: Operator overloads have named alternates
19
19
@@ -32,12 +32,16 @@ By default, this rule only looks at externally visible types, but this is [confi
32
32
33
33
## Rule description
34
34
35
-
Operator overloading allows the use of symbols to represent computations for a type. For example, a type that overloads the plus symbol (+) for addition would typically have an alternative member named 'Add'. The named alternative member provides access to the same functionality as the operator, and is provided for developers who program in languages that do not support overloaded operators.
35
+
Operator overloading allows the use of symbols to represent computations for a type. For example, a type that overloads the plus symbol `+` for addition would typically have an alternative member named `Add`. The named alternative member provides access to the same functionality as the operator. It's provided for developers who program in languages that do not support overloaded operators.
36
36
37
-
This rule examines the operators listed in the following table.
Copy file name to clipboardExpand all lines: docs/ide/create-a-visual-basic-winform-in-visual-studio.md
+32-21Lines changed: 32 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Create a Windows Forms app with Visual Basic"
3
3
description: "Learn how to create a Windows Forms app in Visual Studio with Visual Basic, step-by-step."
4
-
ms.date: 03/23/2019
4
+
ms.date: 09/27/2019
5
5
ms.topic: tutorial
6
6
ms.prod: visual-studio-windows
7
7
ms.technology: vs-ide-general
@@ -10,7 +10,7 @@ author: TerryGLee
10
10
ms.author: tglee
11
11
manager: jillfra
12
12
dev_langs:
13
-
- vb
13
+
- VB
14
14
ms.workload:
15
15
- "multiple"
16
16
---
@@ -41,9 +41,9 @@ First, you'll create a Visual Basic application project. The project type comes
41
41
42
42
1. Open Visual Studio 2017.
43
43
44
-
2. From the top menu bar, choose **File** > **New** > **Project**.
44
+
1. From the top menu bar, choose **File** > **New** > **Project**.
45
45
46
-
3. In the **New Project** dialog box in the left pane, expand **Visual Basic**, and then choose **Windows Desktop**. In the middle pane, choose **Windows Forms App (.NET Framework)**. Then name the file `HelloWorld`.
46
+
1. In the **New Project** dialog box in the left pane, expand **Visual Basic**, and then choose **Windows Desktop**. In the middle pane, choose **Windows Forms App (.NET Framework)**. Then name the file `HelloWorld`.
47
47
48
48
If you don't see the **Windows Forms App (.NET Framework)** project template, cancel out of the **New Project** dialog box and from the top menu bar, choose **Tools** > **Get Tools and Features**. The Visual Studio Installer launches. Choose the **.NET desktop development** workload, then choose **Modify**.
49
49
@@ -59,19 +59,19 @@ First, you'll create a Visual Basic application project. The project type comes
59
59
60
60

61
61
62
-
1. On the **Create a new project** window, enter or type *Windows Forms* in the search box. Next, choose **Visual Basic** from the Language list, and then choose **Windows** from the Platform list.
62
+
1. On the **Create a new project** window, choose the **Windows Forms App (.NET Framework)** template for Visual Basic.
63
63
64
-
After you apply the language and platform filters, choose the **Windows Forms App (.NET Framework)** template, and then choose **Next**.
64
+
(If you prefer, you can refine your search to quickly get to the template you want. For example, enter or type *Windows Forms App* in the search box. Next, choose **Visual Basic** from the Language list, and then choose **Windows** from the Platform list.)
65
65
66
66

67
67
68
68
> [!NOTE]
69
69
> If you do not see the **Windows Forms App (.NET Framework)** template, you can install it from the **Create a new project** window. In the **Not finding what you're looking for?** message, choose the **Install more tools and features** link.
70
70
>
71
-
> 
72
-
>
71
+
> 
72
+
>
73
73
> Next, in the Visual Studio Installer, choose the Choose the **.NET desktop development** workload.
74
-
>
74
+
>
75
75
> 
76
76
>
77
77
> After that, choose the **Modify** button in the Visual Studio Installer. You might be prompted to save your work; if so, do so. Next, choose **Continue** to install the workload. Then, return to step 2 in this "[Create a project](#create-a-project)" procedure.
@@ -86,49 +86,52 @@ First, you'll create a Visual Basic application project. The project type comes
86
86
87
87
## Create the application
88
88
89
-
After you select your Visual Basic project template and name your file, Visual Studio opens a form for you. A form is a Windows user interface. We'll create a "Hello World" application by adding controls to the form, and then we'll run the application.
89
+
After you select your Visual Basic project template and name your file, Visual Studio opens a form for you. A form is a Windows user interface. We'll create a "Hello World" application by adding controls to the form, and then we'll run the app.
90
90
91
91
### Add a button to the form
92
92
93
93
1. Click **Toolbox** to open the Toolbox fly-out window.
94
94
95
95

96
96
97
-
(If you don't see the **Toolbox** fly-out option, you can open by pressing**Ctrl**+**Alt**+**X**.)
97
+
(If you don't see the **Toolbox** fly-out option, you can open it from the menu bar. To do so, **View** > **Toolbox**. Or, press**Ctrl**+**Alt**+**X**.)
98
98
99
-
2. Click the **Pin** icon to dock the **Toolbox** window.
99
+
1. Click the **Pin** icon to dock the **Toolbox** window.
100
100
101
101

102
102
103
-
3. Click the **Button** control and then drag it onto the form.
103
+
1. Click the **Button** control and then drag it onto the form.
104
104
105
105

106
106
107
-
4. In the **Appearance** section (or the **Fonts** section) of the **Properties** window, type `Click this`, and then press **Enter**.
107
+
1. In the **Appearance** section (or the **Fonts** section) of the **Properties** window, type `Click this`, and then press **Enter**.
108
108
109
109

110
110
111
111
(If you don't see the **Properties** window, you can open it from the menu bar. To do so, click **View** > **Properties Window**. Or, press **F4**.)
112
112
113
-
5. In the **Design** section of the **Properties** window, change the name from **Button1** to `btnClickThis`, and then press **Enter**.
113
+
1. In the **Design** section of the **Properties** window, change the name from **Button1** to `btnClickThis`, and then press **Enter**.
114
114
115
115

116
116
117
+
> [!NOTE]
118
+
> If you've alphabetized the list in the **Properties** window, **Button1** appears in the **(DataBindings)** section, instead.
119
+
117
120
### Add a label to the form
118
121
119
122
Now that we've added a button control to create an action, let's add a label control to send text to.
120
123
121
124
1. Select the **Label** control from the **Toolbox** window, and then drag it onto the form and drop it beneath the **Click this** button.
122
125
123
-
2. In the **Design** section of the **Properties** window, change the name from**Label1** to `lblHelloWorld`, and then press **Enter**.
126
+
1. In either the **Design** section or the **(DataBindings)** section of the **Properties** window, change the name of**Label1** to `lblHelloWorld`, and then press **Enter**.
124
127
125
128
### Add code to the form
126
129
127
130
1. In the **Form1.vb [Design]** window, double-click the **Click this** button to open the **Form1.vb** window.
128
131
129
132
(Alternatively, you can expand **Form1.vb** in **Solution Explorer**, and then click **Form1**.)
130
133
131
-
2. In the **Form1.vb** window, between the **Private Sub**line and the **End Sub**line (or between the **Public Class Form1** line and the **End Class** line), type the following code.
134
+
1. In the **Form1.vb** window, between the **Private Sub** and **End Sub**lines, type or enter `lblHelloWorld.Text = "Hello World!"` as shown in the following screenshot:
132
135
133
136

134
137
@@ -140,13 +143,21 @@ Now that we've added a button control to create an action, let's add a label con
140
143
141
144
Several things will happen. In the Visual Studio IDE, the **Diagnostics Tools** window will open, and an **Output** window will open, too. But outside of the IDE, a **Form1** dialog box appears. It will include your **Click this** button and text that says **Label1**.
142
145
143
-
2. Click the **Click this** button in the **Form1** dialog box. Notice that the **Label1** text changes to **Hello World!**.
146
+
1. Click the **Click this** button in the **Form1** dialog box. Notice that the **Label1** text changes to **Hello World!**.
144
147
145
148

146
149
147
-
Congratulations on completing this quickstart! We hope you learned a little bit about Visual Basic and the Visual Studio IDE. If you'd like to delve deeper, please continue with a tutorial in the **Tutorials** section of the table of contents.
150
+
1. Close the **Form1** dialog box to stop running the app.
151
+
152
+
## Next steps
153
+
154
+
To learn more, continue with the following tutorial:
155
+
156
+
> [!div class="nextstepaction"]
157
+
> [Tutorial: Create a picture viewer](tutorial-1-create-a-picture-viewer.md)
148
158
149
159
## See also
150
160
151
-
*[Quickstart: Create a console app in Visual Studio with Visual Basic](quickstart-visual-basic-console.md)
152
-
*[Learn more about Visual Basic IntelliSense](visual-basic-specific-intellisense.md)
0 commit comments