Writing Code in Visual Basic

We have learned to add controls and change properties at design time.

In this lesson we will learn to write code.

In Visual Basic 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. Writing Code for Buttons
  3. Selecting code from list
  4. Arguments
  5. Concatenation
  6. Sender
  7. The Visible Property
  8. Selecting Events
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: May 23 2017 18:23:18.