Develop a windows application in C#

In this article, we will figure out how to build up a windows application in C#.Net? Here, we are composing the means to make a windows application utilizing C# in Visual Studio.

To create windows application, we have to utilize the studio and follow a few stages:

Stage 1) First of all we dispatch the visual studio.

Develop a windows application in C#

Stage 2) Goto file menu and select new task.

Develop a windows application in C#

Stage 3) Now we select “Visual C#” from the left board and choose “Windows Forms Application” and give a suitable name to our application. Here I gave the name “MyWinApp“.

Develop a windows application in C#

Stage 4) Then A default created structure will show up in our application, similar to this:

Develop a windows application in C#

Here we have the following things:

  • Tool stash
    • It contains apparatus to build up the application.
  • Arrangement Explorer
    • It contains our undertaking point of interest; it shows all records identified with our venture.
  • Property window
    • Utilizing property window we can change the properties of controls which are utilized in our application.

Building the arrangement

We can fabricate our venture or arrangement utilizing construct menu or alternate route key: Ctrl + Shift +B.

Execution of Application

We can execute our application with or without investigating. Here, we use investigate menu or it should likewise be possible by utilizing alternate route key: F5 or CTRL+F5.

Plan an application to show “Hello World” message on MessageBox by tapping one the button control

Most importantly, we make a windows application. And afterwards simplified a catch from tool compartment to holder structure.

Develop a windows application in C#

We can change the name, shading and content and so forth of any control utilizing property window, here we change our structure content to “My First Windows Application” and catch content to “Click Me”.

Presently, we composed code on catch’s snap occasion, we can produce test code for click occasion by “double-tap” on the catch. At that point the produced code will we like this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MyWinApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
}

Here button1_Click capacity will use as a tick occasion, here we can compose code what we need to do on click occasion on the catch. Presently we composed code to show MessageBox to show “Hello World“.

private void button1_Click(object sender, EventArgs e)
{
     MessageBox.Show("Hello World");
}

Execute application utilizing CTRL+F5. Here is the output subsequent to tapping on the catch “Click Me“:

Develop a windows application in C#

Leave a Comment

error: Alert: Content is protected!!