Writing Code in C#

We have learned to change properties at design time.

In this lesson we will learn to write code.

In C# we will write code to execute when an event occurs:

  • when the form loads,
  • when the user clicks a button,
  • or makes a choice,
  • or one of the other events that occur.

Sometimes we will use the code to change properties of the form or the controls.
For instance we want to change the backcolor of the form when the user clicks BtnRed.
We may want to hide a control under certain circumstances.

The possibilities are endless! Let's get started!

Please study the material at each of the links below.

  1. Microsoft Reference: Coding Standards
  2. Writing Code to change properties of the form
  3. Code created
  4. Comments
  5. Code Explanation
  6. Adding events for controls
  7. Adding items to listbox at runtime
  8. Mouse Move Event, Arguments
  9. Using the TextBox Control
  10. Debugging Tools
  11. Creating a Console App
Like us on Facebook:


OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher: Zebra0.com
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License
Last modified: December 25 2017 16:20:53.