diff --git a/.gitignore b/.gitignore
index 1a11e6a762..1ed162d2bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,6 +43,7 @@ ehthumbs_vista.db
[Bb]in/
[Oo]bj/
*.sln
+*.slnx
*.user
# C++
diff --git a/dotnet-desktop-guide/winforms/get-started/create-app-visual-studio.md b/dotnet-desktop-guide/winforms/get-started/create-app-visual-studio.md
index 599999a640..10637c1dd2 100644
--- a/dotnet-desktop-guide/winforms/get-started/create-app-visual-studio.md
+++ b/dotnet-desktop-guide/winforms/get-started/create-app-visual-studio.md
@@ -1,7 +1,7 @@
---
title: "Create a new app with Visual Studio tutorial"
-description: Follow this tutorial to learn how to create a new Windows Forms app for .NET with Visual Studio 2022.
-ms.date: 04/02/2025
+description: Learn how to create a Windows Forms app with Visual Studio 2026 in this step-by-step tutorial. Start building your first app today!
+ms.date: 12/03/2025
ms.service: dotnet-desktop
ms.update-cycle: 365-days
ms.topic: tutorial
@@ -26,9 +26,9 @@ In this tutorial, you:
## Prerequisites
-- [Visual Studio 2022 version 17.12 or later versions](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=learn.microsoft.com&utm_campaign=inline+link&0utm_content=download+vs2022+desktopguide+winforms)
- - Select the [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#modify-workloads)
- - Select the [.NET 9 individual component](/visualstudio/install/modify-visual-studio?view=vs-2022&preserve-view=true#modify-individual-components)
+- [Visual Studio 2026](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=learn.microsoft.com&utm_campaign=inline+link&0utm_content=download+vs2026+desktopguide+winforms)
+ - Select the [.NET desktop development workload](/visualstudio/install/modify-visual-studio?view=visualstudio&preserve-view=true#change-workloads-or-individual-components)
+ - Select the [.NET 10 individual component](/visualstudio/install/modify-visual-studio?view=visualstudio&preserve-view=true#change-workloads-or-individual-components)
## Create a Windows Forms app
@@ -37,7 +37,7 @@ The first step to creating a new app is opening Visual Studio and generating the
01. Open Visual Studio.
01. Select **Create a new project**.
- :::image type="content" source="media/create-app-visual-studio/vs-start-1-intro.png" alt-text="A screenshot of the start dialog from Visual Studio 2022. The 'create a new project' button is highlighted with a red box.":::
+ :::image type="content" source="media/create-app-visual-studio/vs-start-1-intro.png" alt-text="A screenshot of the start dialog from Visual Studio 2026. The 'create a new project' button is highlighted with a red box.":::
01. In the **Search for templates** box, type **winforms**, and wait for the search results to appear.
01. In the **code language** dropdown, choose **C#** or **Visual Basic**.
@@ -48,25 +48,36 @@ The first step to creating a new app is opening Visual Studio and generating the
The following image shows both C# and Visual Basic .NET project templates. If you applied the **code language** filter, the corresponding template is listed.
- :::image type="content" source="media/create-app-visual-studio/vs-start-2-templates.png" alt-text="The term 'winforms' is in a search box and is highlighted with a red box. Arrows from the red box point to two templates, C# and Visual Basic. The templates are also highlighted with a red box. From those red boxes, arrows point down to the 'Next' button which is highlighted with a red box.":::
+ :::image type="content" source="media/create-app-visual-studio/vs-start-2-templates.png" alt-text="Screenshot of Visual Studio's 'Create a new project' dialog with 'winforms' in the search box and Windows Forms App templates highlighted.":::
01. In the **Configure your new project** window, set the **Project name** to _Names_ and select **Next**.
You can also save your project to a different folder by adjusting the **Location** path.
- :::image type="content" source="media/create-app-visual-studio/vs-start-3-name.png" alt-text="A screenshot of the 'configure your new project' dialog from Visual Studio 2022. The 'Project name' textbox has the word 'Names' in it and is highlighted with a red box. The 'Next' button is also highlighted with a red box.":::
+ :::image type="content" source="media/create-app-visual-studio/vs-start-3-name.png" alt-text="A screenshot of the 'configure your new project' dialog from Visual Studio 2026. The 'Project name' textbox has the word 'Names' in it and is highlighted with a red box. The 'Next' button is also highlighted with a red box.":::
01. Finally, in the **Additional information** window, select **.NET 9.0 (Standard Term Support)** for the **Framework** setting, and then select **Create**.
- :::image type="content" source="media/create-app-visual-studio/netdesktop-9.0/vs-start-4-framework.png" alt-text="A screenshot of the 'Additional information' dialog from Visual Studio 2022. The 'Framework' dropdown box has '.NET 9.0 (Standard Term Support)' selected and highlighted with a red box. The 'Create' button is also highlighted with a red box.":::
+ :::image type="content" source="media/create-app-visual-studio/vs-start-4-framework.png" alt-text="A screenshot of the 'Additional information' dialog from Visual Studio 2026. The 'Framework' dropdown box has '.NET 10 (Long Term Support)' selected and highlighted with a red box. The 'Create' button is also highlighted with a red box.":::
Once the app is generated, Visual Studio should open the designer window for the default form, _Form1_. If the form designer isn't visible, double-click on the form in the **Solution Explorer** window to open the designer window.
+### Enable the Toolbox and Properties windows
+
+By default, Visual Studio doesn't open the Toolbox and Properties windows. Visual Studio does remember that you opened these windows and will keep them open in the future.
+
+To open the windows:
+
+01. Select the **View** > **Toolbox** menu item.
+01. Select the **View** > **Properties Window** menu item.
+
+:::image type="content" source="media/create-app-visual-studio/menu-toolbox.png" alt-text="The view menu with both the toolbox item and properties window item highlighted in a Visual Studio 2026 Windows Forms project.":::
+
### Important parts of Visual Studio
Support for Windows Forms in Visual Studio has four important components that you interact with as you create an app:
-:::image type="content" source="media/create-app-visual-studio/vs-main-window.png" alt-text="The important components of Visual Studio 2022 you should know when creating a Windows Forms project for .NET.":::
+:::image type="content" source="media/create-app-visual-studio/vs-main-window.png" alt-text="The important components of Visual Studio 2026 you should know when creating a Windows Forms project for .NET.":::
01. Solution Explorer
@@ -84,11 +95,6 @@ Support for Windows Forms in Visual Studio has four important components that yo
The toolbox contains all of the controls you can add to a form. To add a control to the current form, double-click a control or drag-and-drop the control.
-> [!TIP]
-> If the toolbox isn't visible, you can display it through the **View** > **Toolbox** menu item.
->
-> :::image type="content" source="media/create-app-visual-studio/menu-toolbox.png" alt-text="The view menu with the toolbox item highlighted in a Visual Studio 2022 Windows Forms project.":::
-
## Add controls to the form
With the _Form1_ form designer open, use the **Toolbox** window to add the following controls to the form by dragging them from the toolbox and dropping them on the form:
@@ -100,7 +106,7 @@ With the _Form1_ form designer open, use the **Toolbox** window to add the follo
Position and size the controls according to the following image:
-:::image type="content" source="media/create-app-visual-studio/vs-form-preview.png" alt-text="Visual Studio 2022 designer with the form open for Windows Forms for .NET. There's a listbox to for storing names, a textbox to contain a name, and a button add the name.":::
+:::image type="content" source="media/create-app-visual-studio/vs-form-preview.png" alt-text="Visual Studio 2026 designer with the form open for Windows Forms for .NET. There's a listbox to for storing names, a textbox to contain a name, and a button add the name.":::
You can either move and resize the controls with the mouse to match the previous image, or use the following table to configure each control. To configure a control, select it in the designer, then set the appropriate setting in the **Properties** window. When configuring the form, select the form's title bar.
@@ -128,7 +134,7 @@ You can either move and resize the controls with the mouse to match the previous
Now that the form has all of its controls laid out, the next step is to add event handlers to respond to user input. Go to the form designer and perform the following steps:
01. Select the **Add Name** button control on the form.
-01. In the **Properties** window, select the the events icon :::image type="icon" source="media/create-app-visual-studio/icon-events.png" border="false"::: to list the events of the button.
+01. In the **Properties** window, select the events icon :::image type="icon" source="media/create-app-visual-studio/icon-events.png" alt-text="Events icon from Visual Studio." border="false"::: to list the events of the button.
01. Find the **Click** event and double-click it to generate an event handler.
This action adds the following code to the form:
@@ -158,7 +164,7 @@ Now that the form has all of its controls laid out, the next step is to add even
Now that the event is handled, run the app by pressing the F5 key or by selecting **Debug** > **Start Debugging** from the menu. When the app starts, the form is displayed and you can enter a name in the textbox and select the button.
-:::image type="content" source="media/create-app-visual-studio/app-running.png" alt-text="Running a Windows Forms for .NET app in Visual Studio 2022.":::
+:::image type="content" source="media/create-app-visual-studio/app-running.png" alt-text="Running a Windows Forms for .NET app in Visual Studio 2026.":::
## Related content
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/menu-toolbox.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/menu-toolbox.png
index e06e45412d..534ffd6b17 100644
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/menu-toolbox.png and b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/menu-toolbox.png differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-config-new-project.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-config-new-project.png
deleted file mode 100644
index 690eb26c2a..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-config-new-project.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-create-new-project.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-create-new-project.png
deleted file mode 100644
index 5ef6073412..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-create-new-project.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-select-framework.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-select-framework.png
deleted file mode 100644
index cc5a2e3f36..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-select-framework.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-template-search.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-template-search.png
deleted file mode 100644
index 5b1e8497e7..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-6.0/vs-template-search.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-config-new-project.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-config-new-project.png
deleted file mode 100644
index 690eb26c2a..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-config-new-project.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-create-new-project.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-create-new-project.png
deleted file mode 100644
index 5ef6073412..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-create-new-project.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-select-framework.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-select-framework.png
deleted file mode 100644
index 69a6d29ac8..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-select-framework.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-template-search.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-template-search.png
deleted file mode 100644
index 5b1e8497e7..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-7.0/vs-template-search.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-8.0/vs-start-4-framework.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-8.0/vs-start-4-framework.png
deleted file mode 100644
index a32125374c..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-8.0/vs-start-4-framework.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-9.0/vs-start-4-framework.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-9.0/vs-start-4-framework.png
deleted file mode 100644
index 8e0d57b192..0000000000
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/netdesktop-9.0/vs-start-4-framework.png and /dev/null differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-form-preview.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-form-preview.png
index 630fe57e65..f28593b70f 100644
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-form-preview.png and b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-form-preview.png differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-main-window.pdn b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-main-window.pdn
index f04b7f591b..f9491b6a16 100644
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-main-window.pdn and b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-main-window.pdn differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-main-window.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-main-window.png
index 702db7519f..27049e5352 100644
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-main-window.png and b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-main-window.png differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-1-intro.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-1-intro.png
index bc1a9ef55d..8aaabf8de5 100644
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-1-intro.png and b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-1-intro.png differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-2-templates.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-2-templates.png
index c6259d7b36..1565b43796 100644
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-2-templates.png and b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-2-templates.png differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-3-name.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-3-name.png
index cb4e1a192b..97af859f7d 100644
Binary files a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-3-name.png and b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-3-name.png differ
diff --git a/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-4-framework.png b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-4-framework.png
new file mode 100644
index 0000000000..26ef10ef09
Binary files /dev/null and b/dotnet-desktop-guide/winforms/get-started/media/create-app-visual-studio/vs-start-4-framework.png differ
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.Designer.cs b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.Designer.cs
index fcad6afc16..1143edd516 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.Designer.cs
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.Designer.cs
@@ -28,68 +28,66 @@ protected override void Dispose(bool disposing)
///
private void InitializeComponent()
{
- this.label1 = new System.Windows.Forms.Label();
- this.lstNames = new System.Windows.Forms.ListBox();
- this.txtName = new System.Windows.Forms.TextBox();
- this.btnAdd = new System.Windows.Forms.Button();
- this.SuspendLayout();
+ label1 = new Label();
+ lstNames = new ListBox();
+ btnAdd = new Button();
+ txtName = new TextBox();
+ SuspendLayout();
//
// label1
//
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(12, 9);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(44, 15);
- this.label1.TabIndex = 0;
- this.label1.Text = "Names";
+ label1.AutoSize = true;
+ label1.Location = new Point(12, 9);
+ label1.Name = "label1";
+ label1.Size = new Size(44, 15);
+ label1.TabIndex = 0;
+ label1.Text = "Names";
//
// lstNames
//
- this.lstNames.FormattingEnabled = true;
- this.lstNames.ItemHeight = 15;
- this.lstNames.Location = new System.Drawing.Point(12, 27);
- this.lstNames.Name = "lstNames";
- this.lstNames.Size = new System.Drawing.Size(120, 94);
- this.lstNames.TabIndex = 1;
+ lstNames.FormattingEnabled = true;
+ lstNames.Location = new Point(12, 27);
+ lstNames.Name = "lstNames";
+ lstNames.Size = new Size(120, 94);
+ lstNames.TabIndex = 1;
//
- // txtName
+ // btnAdd
//
- this.txtName.Location = new System.Drawing.Point(138, 26);
- this.txtName.Name = "txtName";
- this.txtName.Size = new System.Drawing.Size(100, 23);
- this.txtName.TabIndex = 2;
+ btnAdd.Location = new Point(138, 55);
+ btnAdd.Name = "btnAdd";
+ btnAdd.Size = new Size(100, 23);
+ btnAdd.TabIndex = 2;
+ btnAdd.Text = "Add Name";
+ btnAdd.UseVisualStyleBackColor = true;
+ btnAdd.Click += btnAdd_Click;
//
- // btnAdd
+ // txtName
//
- this.btnAdd.Location = new System.Drawing.Point(138, 55);
- this.btnAdd.Name = "btnAdd";
- this.btnAdd.Size = new System.Drawing.Size(100, 23);
- this.btnAdd.TabIndex = 3;
- this.btnAdd.Text = "Add Name";
- this.btnAdd.UseVisualStyleBackColor = true;
- this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
+ txtName.Location = new Point(138, 26);
+ txtName.Name = "txtName";
+ txtName.Size = new Size(100, 23);
+ txtName.TabIndex = 3;
//
// Form1
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(252, 141);
- this.Controls.Add(this.btnAdd);
- this.Controls.Add(this.txtName);
- this.Controls.Add(this.lstNames);
- this.Controls.Add(this.label1);
- this.Name = "Form1";
- this.Text = "Names";
- this.ResumeLayout(false);
- this.PerformLayout();
-
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(252, 141);
+ Controls.Add(txtName);
+ Controls.Add(btnAdd);
+ Controls.Add(lstNames);
+ Controls.Add(label1);
+ Name = "Form1";
+ Text = "Names";
+ ResumeLayout(false);
+ PerformLayout();
}
#endregion
private Label label1;
private ListBox lstNames;
- private TextBox txtName;
private Button btnAdd;
+ private TextBox txtName;
}
-}
\ No newline at end of file
+}
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.cs b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.cs
index 8d9682ca0b..1505a20999 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.cs
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.cs
@@ -15,4 +15,4 @@ private void btnAdd_Click(object sender, EventArgs e)
}
//
}
-}
\ No newline at end of file
+}
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.resx b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.resx
index f298a7be80..8b2ff64a11 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.resx
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Form1.resx
@@ -1,4 +1,64 @@
-
+
+
+
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Names.csproj b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Names.csproj
index c27cd77f22..5151c0a87e 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Names.csproj
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Names.csproj
@@ -2,7 +2,7 @@
WinExe
- net9.0-windows
+ net10.0-windows
enable
true
enable
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Names.slnx b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Names.slnx
new file mode 100644
index 0000000000..81a8e501a3
--- /dev/null
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Names.slnx
@@ -0,0 +1,3 @@
+
+
+
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Program.cs b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Program.cs
index ad73690bf1..294282bec6 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Program.cs
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/csharp/Program.cs
@@ -8,6 +8,8 @@ internal static class Program
[STAThread]
static void Main()
{
+ // To customize application configuration such as set high DPI settings or default font,
+ // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/ApplicationEvents.vb b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/ApplicationEvents.vb
index cf403a009a..3445e6db32 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/ApplicationEvents.vb
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/ApplicationEvents.vb
@@ -3,9 +3,9 @@
Namespace My
' The following events are available for MyApplication:
' Startup: Raised when the application starts, before the startup form is created.
- ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
+ ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
' UnhandledException: Raised if the application encounters an unhandled exception.
- ' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
+ ' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application.
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Form1.Designer.vb b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Form1.Designer.vb
index 0d0a0f70e6..10d7078c4d 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Form1.Designer.vb
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Form1.Designer.vb
@@ -4,7 +4,7 @@ Partial Class Form1
'Form overrides dispose to clean up the component list.
- Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+ Protected Overrides Sub Dispose(disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
@@ -18,68 +18,67 @@ Partial Class Form1
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
+ 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Private Sub InitializeComponent()
- Me.btnAdd = New System.Windows.Forms.Button()
- Me.txtName = New System.Windows.Forms.TextBox()
- Me.lstNames = New System.Windows.Forms.ListBox()
- Me.label1 = New System.Windows.Forms.Label()
- Me.SuspendLayout()
- '
- 'btnAdd
- '
- Me.btnAdd.Location = New System.Drawing.Point(138, 55)
- Me.btnAdd.Name = "btnAdd"
- Me.btnAdd.Size = New System.Drawing.Size(100, 23)
- Me.btnAdd.TabIndex = 7
- Me.btnAdd.Text = "Add Name"
- Me.btnAdd.UseVisualStyleBackColor = True
- '
- 'txtName
- '
- Me.txtName.Location = New System.Drawing.Point(138, 26)
- Me.txtName.Name = "txtName"
- Me.txtName.Size = New System.Drawing.Size(100, 23)
- Me.txtName.TabIndex = 6
- '
- 'lstNames
- '
- Me.lstNames.FormattingEnabled = True
- Me.lstNames.ItemHeight = 15
- Me.lstNames.Location = New System.Drawing.Point(12, 27)
- Me.lstNames.Name = "lstNames"
- Me.lstNames.Size = New System.Drawing.Size(120, 94)
- Me.lstNames.TabIndex = 5
- '
- 'label1
- '
- Me.label1.AutoSize = True
- Me.label1.Location = New System.Drawing.Point(12, 9)
- Me.label1.Name = "label1"
- Me.label1.Size = New System.Drawing.Size(44, 15)
- Me.label1.TabIndex = 4
- Me.label1.Text = "Names"
- '
- 'Form1
- '
- Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
- Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
- Me.ClientSize = New System.Drawing.Size(252, 141)
- Me.Controls.Add(Me.btnAdd)
- Me.Controls.Add(Me.txtName)
- Me.Controls.Add(Me.lstNames)
- Me.Controls.Add(Me.label1)
- Me.Name = "Form1"
- Me.Text = "Names"
- Me.ResumeLayout(False)
- Me.PerformLayout()
-
+ btnAdd = New Button()
+ Label1 = New Label()
+ txtName = New TextBox()
+ lstNames = New ListBox()
+ SuspendLayout()
+ '
+ ' btnAdd
+ '
+ btnAdd.Location = New Point(163, 115)
+ btnAdd.Name = "btnAdd"
+ btnAdd.Size = New Size(75, 23)
+ btnAdd.TabIndex = 0
+ btnAdd.Text = "Button1"
+ btnAdd.UseVisualStyleBackColor = True
+ '
+ ' Label1
+ '
+ Label1.AutoSize = True
+ Label1.Location = New Point(34, 43)
+ Label1.Name = "Label1"
+ Label1.Size = New Size(41, 15)
+ Label1.TabIndex = 1
+ Label1.Text = "Label1"
+ '
+ ' txtName
+ '
+ txtName.Location = New Point(118, 43)
+ txtName.Name = "txtName"
+ txtName.Size = New Size(100, 23)
+ txtName.TabIndex = 2
+ '
+ ' lstNames
+ '
+ lstNames.FormattingEnabled = True
+ lstNames.Location = New Point(12, 91)
+ lstNames.Name = "lstNames"
+ lstNames.Size = New Size(120, 94)
+ lstNames.TabIndex = 3
+ '
+ ' Form1
+ '
+ AutoScaleDimensions = New SizeF(7F, 15F)
+ AutoScaleMode = AutoScaleMode.Font
+ ClientSize = New Size(800, 450)
+ Controls.Add(lstNames)
+ Controls.Add(txtName)
+ Controls.Add(Label1)
+ Controls.Add(btnAdd)
+ Name = "Form1"
+ Text = "Form1"
+ ResumeLayout(False)
+ PerformLayout()
End Sub
- Private WithEvents btnAdd As Button
- Private WithEvents txtName As TextBox
- Private WithEvents lstNames As ListBox
- Private WithEvents label1 As Label
+ Friend WithEvents btnAdd As Button
+ Friend WithEvents Label1 As Label
+ Friend WithEvents txtName As TextBox
+ Friend WithEvents lstNames As ListBox
+
End Class
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Form1.resx b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Form1.resx
index f298a7be80..8b2ff64a11 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Form1.resx
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Form1.resx
@@ -1,4 +1,64 @@
-
+
+
+
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/My Project/Application.Designer.vb b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/My Project/Application.Designer.vb
index 007b31fc7d..86fcf0fab9 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/My Project/Application.Designer.vb
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/My Project/Application.Designer.vb
@@ -8,12 +8,9 @@
'
'------------------------------------------------------------------------------
-Option Strict On
-Option Explicit On
-
Namespace My
- 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
+ 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to Project Properties or double-click the My Project node in
' Solution Explorer), and make changes on the Application tab.
diff --git a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/NamesVB.vbproj b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Names.vbproj
similarity index 93%
rename from dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/NamesVB.vbproj
rename to dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Names.vbproj
index 78c8685bf4..082a8c14be 100644
--- a/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/NamesVB.vbproj
+++ b/dotnet-desktop-guide/winforms/get-started/snippets/create-app-visual-studio/vb/Names.vbproj
@@ -2,7 +2,7 @@
WinExe
- net9.0-windows
+ net10.0-windows
Sub Main
true
WindowsForms