Loading...

Starting Windows Form Application in C#, Step by Step Tutorial

Windows Form Application:

Our some followers demand of posting a easy tutorial to start programming in C#, which can be understood easily by a Newbie. So here is the tutorial for starting Win Form Application which can be learnt by a person who have no idea about Windows Form Application.

Let's Start from here:

  • Open Win Form Application in Visual Studio.

  • This Form will open.
  • Drag some items from tool box like button, Combo Box and Text Box. You can also take them by double clicking on any tool.







  • Now remember one thing, that by double clicking any tool will make an event of that tool in Form class, and whatever code you write in that event will execute when that event is done. For example when you double click on button , an event of Button_click will form which is a method, now write your code in that method that you want to execute when button is clicked. 
  • When you do double click on Text box, text changed event will form, and the code in that event will execute when text is changed in text box.
  • Like wise when you do double click on Combo Box , selected_item_changed event will form, which will execute when you select a option from Combo box.

Code:


private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
                 // write code here that u want to execute when combo box option is changed
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
              // when text is changed
        }

        private void button1_Click(object sender, EventArgs e)
        {
           // code which you want to execute when u click the button on runtime
        }


  • You can change the properties of tools from here:

Thank you for reading, Like this if it helped, It helps a lot to keep us motivated

0 comments:

Post a Comment

Google+

 
TOP