akosiraff

Membership List VB 2010

Jul 28th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/membership-list-vb-2010/
  3.  
  4. This is based on Programming Project 1 of Chapter 9, page 451, but there are significant modifications!
  5. Write a menu-driven program to manage a membership list. The menus, with various short-cuts, are to be these:
  6. File
  7. Edit
  8. New
  9. Add F1
  10. Open
  11. Modify F2
  12. Save
  13. Delete F3
  14. Exit
  15. Only New, Open, Exit are enabled when the program first opens. Once a file is open, Save is enabled only after a change and disabled again after a save (i.e., Save is enabled only when the internal data is different from the file); and Modify, Delete are enabled only if a member name is selected in the list box.
  16. New, Open, Save will use a standard file dialog to allow a user to specify a file and location.
  17. Add, Modify display a secondary form. In the case of Add, the form is blank; with Modify it shows the current data for the selected record. The program will not allow two identical names to be added to the list.
  18. Delete must ask for confirmation before deleting.
  19. Exit must check whether Save is enabled, and if it is must query the user if the data should be saved. Use a Yes/No/Cancel option for this: Yes means save and exit; No means exit without saving; Cancel means no save, no exit. For example:
  20. Select Case MessageBox.Show(“Data has changed. Save?”, “Open File”, MessageBoxButtons.YesNoCancel)
  21. Case DialogResult.Yes
  22. Case DialogResult.No
  23. Case DialogResult.Cancel
  24. End Select
  25. Open must check whether Save is enabled and similarly query a save of the current file before opening a new one.
  26. There is no need to validate the phone numbers. You will probably want to make sure that the name is not blank, however, and that it is not a duplicate name.
  27. You may find it useful to know that list boxes have a Sorted (Boolean) property. To add an item to a list box, use Items.Add(name) ; to delete an item, you can use Items.Remove(name) ; to find out if an item is present in the list, use Items.Contains(newname) — this won’t take upper/lower case differences into account, but will do for this assignment.
  28. There is a FormClosing event that is triggered when the user clicks the “x” in the top right corner. You should also handle the possibility that there is unsaved data, as for the Exit menu item. In this case, the way to cancel the close in the event procedure is:
  29. e.Cancel = True
  30. Download: http://solutionzip.com/downloads/membership-list-vb-2010/
Advertisement
Add Comment
Please, Sign In to add comment