All Type Coding

Search Here

How to create a Window Application in c#

First of all Open visual studio go to-> file ->new ->project
after that select like below image



























when you will click on ok button then a window form will open in front of you in your project like below



















what I did here drag a button like above after that double click on button and write red color code inside the button event like below

using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

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

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

}

When you executing this c# window program the output will be:





















No comments :

Post a Comment