Introducing To Windows Forms Application Using Visual Studio

Hi and Welcome

Introducing to Windows Forms application using Visual Studio.

Today we learn First Lesson of Windows Forms application using Visual Studio and C #. and say To “Hello World”. In visual Studio Select new Project and choose Windows Forms Application then click ok, When you created WindowsFormsApplication1 project, Visual Studio also created a solution. Solution is just a group of projects. 

References – Contains a list of all libraries required by the project. 

Form1.cs – This is Widnows Forms Template You can see Program.cs. This is main file of Any Program in Visual Studio because complier start debugging from Void Main Mathod. Pls see the below screen shot.

Application.Run(new Form1()); // This Starting point of Form. If we change it to Form2.cs then when application is debug. its starting from Form2.cs

Now you can Change Form1.cs name to frmhelloworld.cs. solution explorer there is option File Name. you can change it from there.

You can add more Forms – In the Solution Explorer Right Click -> Add ->New Item > Windows Form

Select Windows Form and click Add. You see Form2.cs was added.
Now we need Say “Hello World” using c# Code. Double Click on Form1.cs. you can see code was generated by Visual Studio to start our own Programme.

Now its time to add Button in Form1.cs Click on Toolbox Right Hand Side our project select Button. Drag the Button to Form1.cs Double Click on Button. you can see below code. Automatic generated by Visual Studio.

Now run F5. Then you click on Button its says This is Our Very Fist Windows Forms Project, Hello World.

I hope this post is helpful for you to understant and make things work on Introducing to C Sharpe Lesson 1 with Installing Visual Studio. Please keep visiting share .. wait for next part

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *