C#.Net Lesson 1


Here we are with the first lesson of C#.Net. What we are going to do is starting with our first program. The step by step procedure will help you understanding the lesson properly. For further help, you can comment down below the post

Program will show how you can pop up the message box and display “Hello World !” into the messagebox.

  •  Start the visual studio ide , go to new project and you will find lots of templates in your visual studio ide

  • Here You will have to select .Net Framework 4.0 , language c# and the template as per highlighted (Windows Form Application). Down below The name you want to assign to your project , browse the location of your hard disk you want to save your project. After you are done. click ok and the ide is ready for your working.
  •  This is how your ide will look like after selecting the template. Now let us discus about the solution explorer at the top right corner as per highlighted

  • You use Solution Explorer to manage project items and browse through different files of your code. You can add projects, reference files, items, classes, dlls etc. You can move to folders, delete files from this Solution Explorer. You will find every thing while you will start doing your work with ide.
  • In the Solution Explorer you can find the file named as Form1 . cs. This is known as the default form that we are going to work with in our firs lesson.
  •  In the above picture you can see a Form that is displayed at the top let panel if your ide. It is a default form you can create your own too, you will find it later, let us move further to this lesson.
  • Down below is a toolbox available for you by the ide. You can drag the tools you need for your project and drop the tool to the form and can set the position of the tool , where ever you need it to be displayed.

  • In this lesson we will you only a button tool. So, drag and drop button tool to your form. and set the position of the button where you want it to be displayed within the form. You can set the width and height of your form with the help of setting up the properties and with the help of your mouse too. Down below you can see a properties panel where you can set properties like color, background, name, size, font and plenty of other things. Explore it and you will find it. For further help email us or comment down below the post.

  • Now after setting some properties for your form and button tool your work will look like this

  •  Now it is time to go in coding. Double click on the button in your form and you will find your self in a coding portion of your ide. After double clicking the button the ide will generate an event (Code) for your button.
  • For the time being skip all the code just concentrat on the button click event in your code. You will come to know other things in a later lesson .

  •  After this you will type a code here  in the button clock event.

  •  After this it is time to save and compile your code.
  • Pres ctrl+s to save the file and then press F5 from your keyboard to Run your first program. After the project is executed. You will find the form you prepared in visual studio ide .
  • Click the button and the messagebox will appear in front of you.

The end of the first lesson at Umbrella Developers .For further discussion feel free to contact us , post comments below and have the answers to your problems . Thank you.

If you enjoyed this article, Get email updates (It’s Free)

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

4 Responses

  1. zain
    zain at | | Reply

    Sir please share , more material .. thx in advance

  2. khawaja hafeez
    khawaja hafeez at | | Reply

    nice Lesson


Leave a Reply