CPS613

Module 09-DynamicControls

Toronto Metropolitan University University

Learning Objectives

In this module you will learn how to
  • create and work with extended controls
  • generate new controls dynamically and be able to interact with them
  • work with .NET arrays

Module Description:

Summary

In this module you will be developing a simple program to dynamically generate and discard square boxes on the screen.

User Interface and Interaction

The application will behave like ModuleDynamicControls.zip

In particular

  1. The U.I. should include a button with which the user can create a new box, and display it on screen.
  2. The boxes are automatically numbered in the order in which they are created and displayed in an orderly fashion.
  3. The U.I. should also include facilities to delete one of the boxes by specifying its number. The point of this is to access the box indirectly by its number rather than directly by clicking on it.
  4. When new boxes are created after boxes have been deleted, the positions left empty by the deleted boxes should be filled in order in a visible way. E.g. in the example, delete one a few of the middle boxes and then add more boxes.
  5. There should be no limit to the number of boxes that can be created and deleted.

Implementation Details

  1. The boxes are extended Button controls called "Box" which simply contain the number representing their position.
  2. The boxes should be dynamically generated at run-time instead of statically at compile-time.
  3. The boxes should be kept in an array.

Handouts

In the Handouts directory you will find:

References

References for this module are in the User Defined Controls Reference and in the Microsoft reference on Arrays in Visual Basic
Explanations of all VB features needed for all the modules can be found at the General Assignment References page


This page is maintained by Sophie Quigley (cps613@cs.torontomu.ca)
Last modified Thursday, 20-Oct-2022 02:01:41 EDT