Wednesday, August 8, 2007

Programming Exercise 6: Windows Forms 2

Continuing from exercise #5, create a User Management application that maintains a list of User records. The application should support the following operations:
  • Add a new User record
  • Navigate through the list
The application should contain the following buttons:
  • Prev - moves to the previous User record
  • Next - moves to the next User record
  • New - clears and enables all textboxes for record entry
  • Save - adds a new User record to the list
  • Cancel - clears and disables all textboxes without adding a User record to the list
Upon application startup, all form controls (textboxes and buttons) except the New button are disabled. When the New button is clicked, the Save and Cancel buttons, as well as textboxes except the current index, are enabled. Clicking on the Save button will create a User record with values based on the values entered in the textboxes. This new record will be added to the list.

If there are already records in the list, the application should allow navigation through the Prev and Next buttons. The current index textbox should also be updated based on the record's index in the list. If the current index is 0, the Prev button is disabled. If the current index is equal to the number of records in the list, the Next button is disabled.

You can download the sample output here.