The following zip files include examples of basic programs and techniques in Visual C#.  The examples are intended to be followed in a linear manner.  The code is commented where necessary.

vcs_ex1.zip

  • Very simple "Hello World" program
  • Illustrates use of Label and Button controls
  • Code illustrates ending a program

vcs_ex2.zip

  • Simple calculator program with four math functions
  • Illustrates use of Label, Button, and TextBox controls
  • Code shows math functionality and reading/writing values to and from controls
  • Introduces variables declared in code

vcs_ex3.zip

  • Simple password program asking user to enter a password
  • Introduces If...Then statement to compare entry to a password constant

vcs_ex4.zip

  • List program that generates a list of numbers based on user input
  • Introduces ListBox control
  • Introduces For...Next loop

vcs_ex5.zip

  • Prime number finder; displays the number of primes found between 1 and n
  • Introduces Classes
  • Introduces private and public functions
  • Uses For...Next loop
  • Illustrates use of Messagebox parameters

vcs_ex6.zip

  • Name list program; asks user for name inputs and stores them in a dynamic array
  • Resizes array while preserving data each time a user adds a name
  • Lists all the names in the array upon command
  • Uses For...Next loop
  • Uses the Array class and the Sort method to organize the list