May 26, 2017 In Visual Studio, where Xamarin is installed, we have the Xamarin Mac Agent that allows you to run iOS Simulator. For commercial choice of Apple, the iOS app build and deploy process must pass through a Mac machine, so if you have a Windows machine, you need either a Mac or a Mac. Moving a Windows Forms app over to either a Mac or Linux machine used to be nearly impossible. With Mono it's almost as easy as recompile and run. In this article we'll take a look at a sample C# programming database application and show it running on both Mac OS X and Linux. Open Visual Studio 2019. On the start window, choose Create a new project. On the Create a new project window, enter or type Windows Forms in the search box. Next, choose Desktop from the Project type list. After you apply the Project type filter, choose the Windows Forms App (.NET Framework) template for either C# or Visual Basic, and then choose Next. Visual Studio 2017/2019 for Windows or Visual Studio for Mac. Mobile development with.NET workload for Visual Studio. If you followed along with the first post in this series you should be set up with at least one mobile device emulator, either iOS or Android, and the code for a mobile app. Windows Forms is a set of classes that encapsulates the creation of the graphical user interface (GUI) portion of a typical desktop application. Previously, each programming language had its own way of creating windows, text boxes, buttons, etc. This functionality has all been moved into the.NET Framework class library—into the types located in the System.Windows.Forms namespace.
-->
When you create a picture viewer, the first step is to create a Windows Forms App project.
Open Visual Studio 2017
-
On the menu bar, choose File > New > Project. The dialog box should look similar to the following screenshot.
New projectdialog box -
On the left side of the New Project dialog box, choose either Visual C# or Visual Basic, and then choose Windows Desktop.
-
In the project templates list, choose Windows Forms App (.NET Framework). Name the new form PictureViewer, and then choose the OK button.NoteIf you don't see the Windows Forms App (.NET Framework) template, use the Visual Studio Installer to install the .NET desktop development workload.
For more information, see the Install Visual Studio page.
Open Visual Studio 2019
-
On the start window, choose Create a new project.
-
On the Create a new project window, enter or type Windows Forms in the search box. Next, choose Desktop from the Project type list.After you apply the Project type filter, choose the Windows Forms App (.NET Framework) template for either C# or Visual Basic, and then choose Next.NoteIf you don't 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.Next, in the Visual Studio Installer, choose the Choose the .NET desktop development workload.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.
-
In the Configure your new project window, type or enter PictureViewer in the Project name box. Then, choose Create.
Visual Studio For Mac Extensions
Visual Studio creates a solution for your app. A solution acts as a container for all of the projects and files needed by your app. These terms will be explained in more detail later in this tutorial.
About the Windows Forms App project
-
The development environment contains three windows: a main window, Solution Explorer, and the Properties window.If any of these windows are missing, you can restore the default window layout. On the menu bar, choose Window > Reset Window Layout.You can also display windows by using menu commands. On the menu bar, choose View > Properties Window or Solution Explorer.If any other windows are open, close them by choosing the Close (x) button in their upper-right corners.
- Main window In this window, you'll do most of your work, such as working with forms and editing code. The window shows a form in the Form Editor. At the top of the window, the Start Page tab and the Form1.cs [Design] tab appear. (In Visual Basic, the tab name ends with .vb instead of .cs.)
- Main window In this window, you'll do most of your work, such as working with forms and editing code. The window shows a form in the Form Editor.
- Solution Explorer window In this window, you can view and navigate to all items in your solution.
If you choose a file, the contents of the Properties window changes. If you open a code file (which ends in .cs in C# and .vb in Visual Basic), the code file or a designer for the code file appears. A designer is a visual surface onto which you can add controls such as buttons and lists. For Visual Studio forms, the designer is called the Windows Forms Designer.-
Properties window In this window, you can change the properties of items that you choose in the other windows. For example, if you choose Form1, you can change its title by setting the Text property, and you can change the background color by setting the Backcolor property.NoteThe top line in Solution Explorer shows Solution 'PictureViewer' (1 project), which means that Visual Studio created a solution for you. A solution can contain more than one project, but for now, you'll work with solutions that contain only one project.
-
On the menu bar, choose File > Save All.As an alternative, choose the Save All button on the toolbar, which the following image shows.
Save Alltoolbar buttonVisual Studio automatically fills in the folder name and the project name and then saves the project in your projects folder.
Next steps
Windows Forms App Visual Studio For Mac Free
-
To go to the next tutorial step, see Step 2: Run your app.
-
To return to the overview topic, see Tutorial 1: Create a picture viewer.