Hi,
These are the steps that needs to be followed:
- First, open Visual Studio.
- On the top left click New, then click on Project.
- Alternatively, you can press Clrl+Shift+N to do this.
- You will now be directed to Project window where you will be
asked to select the type of project and there on the left side,
you'll see the Visual C# option and after you click that you will
see the windows option right below it. Click it and you will see
list of templates on the right side. Choose Windows Forms
Application.
- Set the name for project(Your application name) and click on
OK.
- You're ready to code now.
- On the left side(or right side depending on layout) you'll see
many options and at the bottom will be Form1.cs and Program.cs
- The Form1.cs will contain the code you will write for the
Application basically you will define functionalities for your
application here.
- The Program.cs file will contain the startup code which will be
used to access all the code you created in the Form file.
- Now, you can add controls to the application like adding a text
field to get a value, adding RadioButtons, labels, check boxes,
button and basically everything that the user will interact
with.
- You can modify these properties the way you like to
- Next step will be event handling via which you will basically
set how the combination of controls work.
For example, clicking a button might take all the data from the
input fields and store them in storage
and so on
- So, when your functionality of the prgram is complete you're
ready for the next step which is exporting this into a windows
application(.exe file)
- Now, without closing your current project, right click on
Solution (location on the top of the window containing Form1.cs and
Program.cs) and click on Add and then click on New Project
- It will lead you to the project selection window again and this
time select Other Project types on the left side, and then VIsual
studio installer on the left side, and then click on setup Project
on the right side.
- Give your setup a name for example, setup and click on OK
- Project will open. On the top click on View -> File
System
- It will show you file system manager containing 3 location :
Application Folder, User's Desktop, User's Program Menu
- For each of the 3 locations listed:
- right click -> select add -> project output and you will
be displayed a list, from there select primary output and hit
OK.
- again right click -> property window, on right side there
will be a property called Always create, set it to true
- Note: do the above 2 steps for all 3 locations listed in the
file system manager
- Now, go to your Debug directory(you will find this folder in
the location where your setup project is located)
- In the directory you will setup file. Install it.(By default it
installs in program files directory)
That's it. You can open your program from the directory you
installed it in!