Visual Basic 2010 Program: Maze - Create your Maze Without Using Labels

Introduction

In the Visual Studio Help Viewer 1.1 there is an example program called Maze
In order to study this example in tab "Contents" make the following selections:
Helper Viewer Home, Visual Studio 2010, Visual Studio, Visual Studio Languages, Visual Basic and Visual C#, Getting Started Tutorials, Tutorial 2: Create a Maze., Step 2: Create Your Maze using Labels.
In Step 2 you build the maze by using Label controls for each wall. In this example the maze has 40 walls, that means 40 Labels. Those Labels are called: Label1 until Label40. The building of this maze is a very time consuming effort. What is worse: Label controls do not support the array concept.
The program Maze discussed here solves both problems. The whole idea is to use the Toolbox as less as possible. In fact the whole program is based on features that were also available in Visual Basic 5.0.
The only new feature from Visual Basic 2010 that it uses is the BitMap. The Bitmap is used to store and save the maze.

VB Program: Maze - Data Base Description

The program contains two forms: Maze Form1 and Maze Form2.

Besides tools the program uses variables. The most important variables are:

The following pictures show the initial set up and the final setup
  1 1 1 1 1 1 1
  - -   -   - 1
  1   1   1   1
  1 -   -   - 1
  1   1   1   1
  1 -   -   - -
  1 1 1 1 1 1 1
 
    Figure 1
  1 1 1 1 1 1 1
  - - - - 2 2 1
  1 2 1 - 1 2 1
  1 2 1 - 1 2 1
  1 1 1 - 1 1 1
  1 2 2 - - - -
  1 1 1 1 1 1 1

    Figure 2

VB Program Maze: Program Operation

Operation of the program consists of two phases: Maze building and Play.