

- Webmap viewer .net how to#
- Webmap viewer .net install#
- Webmap viewer .net code#
- Webmap viewer .net download#
In the Add New Item window, on the left, select Visual C# Items > Windows Forms. Select Project > Add Form (Windows Forms).
Webmap viewer .net how to#
The starter project has a Form1.cs form already, but we'll add another, as Form2.cs, to see how to do that. Now that the WebView2 SDK is installed for the WinForms project, add a WebView2 control to the app, as follows: Step 5 - Create a single WebView2 control

Webmap viewer .net code#
You've added the WebView2 SDK to the project, but haven't added any WebView2 code to the project yet. The running project displays the same empty window as before: Select Debug > Start Debugging ( F5) to build and run the project. Select File > Save All ( Ctrl+ Shift+ S) to save the project.

Webmap viewer .net install#
To zoom, right-click > Open image in new tab.Ĭlick the Install (or Update) button. In the search bar, type WebView2, and then below the search bar, click 2 to select it: The NuGet Package Manager opens in Visual Studio. In Solution Explorer, right-click the project name (not the solution name above it), and then select Manage NuGet Packages: Use NuGet to add the WebView2 SDK to the project, as follows: You install the 2 SDK NuGet package for use by the current project. Step 4 - Install the WebView2 SDKįor every WebView2 project, you use the NuGet package manager within Visual Studio to add the WebView2 SDK to the project. Next, set up the project to add WebView2 content. You now have an empty WinForms project that runs. Select File > Save All ( Ctrl+ Shift+ S).Īn empty Form1 window opens, from the fresh WinForms project: The Visual Studio window opens, showing the baseline WinForms project in the Solution Explorer, and showing a Form Designer window: In the Location text box, enter a path, such as "C:\Users\username\Documents\MyWebView2Projects". This tutorial article uses the name WinForms_GettingStarted, like the repo's directory name for the completed project. In the Project name text box, enter a project name. Make sure the name matches, with a C# icon and then the name Windows Forms App (.NET Framework).

Select the C# Windows Forms App (.NET Framework) card. Search results appear, listing project types. In the Search text box, paste or start typing the following: C# Windows Forms App (.NET Framework) The Visual Studio Create a new project window opens. On the right, click the Create a new project card. The Visual Studio Open recent window appears: Start with a basic desktop project that contains a single main window. If Visual Studio isn't installed already, open the page Microsoft Visual Studio in a new window or tab, and install Visual Studio 2017 or later, such as Visual Studio 2022 Professional. Microsoft Visual Studio Code is not supported for this tutorial. The sample in the repo might not be as up-to-date as a project that you create by using the latest Visual Studio project templates.
Webmap viewer .net download#
See Download the WebView2Samples repo in Set up your Dev environment for WebView2. This will give you the latest code and project structure.Ĭlone or download the WebView2Samples repo, open the completed project in Visual Studio, and follow the steps in this article to understand creating the WinForms project and understand the added WebView2 code. Step 1 - Optionally clone or download the WebView2Samples repoĬreate a new project in Visual Studio starting from a project template, using the steps in the sections below. Learn about WebView2 concepts along the way.Install the 2 SDK package for the WinForms project.Use the C# Windows Forms App (.NET Framework) Visual Studio project template to create a WinForms project.
