Tek Eye Logo

Tek Eye

Hello World in C#, A Starting WinForms Example

This article is a short tutorial on creating the most basic application for Windows in C#. A Windows Forms (WinForms) Hello World application. This C# WinForms beginners tutorial assumes that Microsoft Visual Studio is installed and ready to start a new project. Note: Based on experience Microsoft Visual Studio works best on a PC with an i3 or better processor, Solid State Disk (SSD) for the hard drive, 6GB+ of memory, and running Windows 10.

The Hello World program is usually the first program tried when new computers or software are tried out. Here a C# WinForms Hello World example is given. (The same steps are similar for a Visual Basic Hello World application.) With Visual Studio open use the File menu and select New then Project.

New Visual Studio WinForms Project

Select the Windows Forms Application for Visual C# and give it a name. WinForms provides a key building block for writing applications for Windows. WinForms based apps, using the Windows Application Programming Interface (API), have been around for many years, therefore WinForms is widely supported.

From the Visual Studo Toolbox drag and drop a Label onto the form.

Visual Studio

Using the list of Properties change the Label text to Hello, World!.

WinForms Properties

Change other properties if required, e.g. the size of the font, alignment (TextAlign) and anchoring (Anchor). To change the title of the Windows form, click on the form and change the Text property (from Form1 to the required title).

Visual Studio Properties

This simple C# Hello World example app does not need any additional code. To run the application click the Start button on the toolbar. To learn more see the Microsoft Visual Studio guides.

Hello World Demo

See Also

Author:  Published:  

ShareSubmit to TwitterSubmit to FacebookSubmit to Google+Submit to LinkedInSubmit to redditPrint Page

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.



Articles on:

Android, HTML, VPS, Computing, IT, Computer History, ↓markdown↓ CMS



Free Android Projects and Samples:

Android Examples, Android List Examples, Android UI Examples