Friday, December 12, 2014

100 Visual Studio 2012 Windows Form Application With C# and .NET 4.5


---
C# WITH .NET FRAMEWORK 4.5
100 Visual Studio 2012 Windows Form Application With C# and .NET 4.5
Contents
1) Create A New Project.
2) Select Template.        
3) Solution Explorer        
4) Form and Code Editor.        
4.1) Form Design        
4.2) Code Editor        
5) Deleting Project and Solution        

1) Create A New Project.

Go to Menu. Select File/New/Project

2) Select Template.

In the New Project Dialog Window, select options.
Template Category: Visual C#/Windows
Framework: .Net Framework 4.5
Template Type: Windows Forms Application
Name: WindowsFormApplication1
Location: {your default visual studio 2012 project path}
Solution Name: WindowsFormApplication1

3) Solution Explorer

3.1) Solution Explorer Panel shows your current Solution containing a Project.
3.2) Form
By default “Form1” is created and opened in the Editor Window.
You can double-click the item to open it at any time.
The Form1 has “.cs” file extension; meaning that it is coded in C-Sharp Language.

4) Form and Code Editor.

4.1) Form Design

4.2) Code Editor

Right-click the form and select View Code.
By default Visual Studio generates the following startup codes.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    }
}

5) Deleting Project and Solution

5.1) To delete a project, right-click its name in Solution Explorer and select Remove.
Click OK to confirm deletion.
5.2) To delete a Solution, you cannot do that through the context menu. The option doesn’t exist.
Right-click the Solution and select Open Folder in File Explorer.
Find the Solution Folder.
5.3) Right-click the Solution Folder and select Delete.
Click OK to confirm deletion.
5.4) Switch back to Visual Studio 2012.
Go to Menu. Select File/Recent Projects and Solutions/WindowsFormsApplication1.sln
Visual Studio 2012 could not find the Solution and ask if you want to remove its reference? Click Yes.
If the Solution name is still shown in Solution Explorer, go to Menu. Select File/Close Solution.
No need to save because we do not perform anything on it.

6) Exercise

6.1) Re-create the WindowsFormApplication1.sln
6.2) Open the Solution Folder in File Explorer.
6.3) Send the folder as a Zip file.
6.4) This zip file serves as a simple backup. You just unzip it later suppose you need a fresh copy of Windows Form Application project.
WARNING:
Before you unzip the compressed file and import the Solution to Visual Studio, make sure that there is no other existing solutions sharing the same name.
Otherwise you may accidentally overwrite the existing Solution files and folders.
---

No comments:

Post a Comment