Microsoft training courses | Wise Owl - home page

Phone (01457) 858877 or email.

Free Microsoft Visual Basic 2005 training exercise

This Visual Basic 2005 exercise of average difficulty is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

You can learn how to do this exercise on the following Wise Owl training course: This course also includes a full answer to this exercise.
First download the files needed to start this exercise: ex-535 (and click here if you experience any problems unzipping this file after downloading it).

Using ErrorProvider controls to check age

Add the form in the above folder to your application, or work with a copy of this form that you have already imported or created.

Add an ErrorProvider control to your form.

Attach code to the Validating event of each of the two text boxes so that:

  • if the length of the name is zero, you show an error next to it
  • if the age isn't an integer, you show an error next to it

Test out your validation:

Visual Basic 2005 exercise - Validating forms (image 1)

This shows that you need to be careful when displaying errors next to textbox controls in panels

Check that your application works, then close down its forms.

All content copyright Wise Owl Business Solutions Ltd 2013. All rights reserved.