COP4226, Extra Credit 2
Due Monday, September 22 (not late until 6 am 9/23)
Create a Windows Forms Application in Visual Studio. The project will use the user settings to
save the size and location of the main form. It will also implement a modeless dialog with
data exchange.
User Settings
Create user settings for the size of the form and the desktop location of the form.
- Use appropriate starting values.
Modeless Dialog
Create a dialog that will be opened modelessly.
- Add a label and textbox for a name.
- Add Ok, Apply and Close buttons.
- When Apply or Ok are clicked, notify any listeners.
- The Close button should only close the form.
- If the Enter Key is hit in the dialog, the Apply button handler should fire.
- If the Escape Key is hit in the dialog, the Close button handler should fire.
- Implement an interface for the name and an event.
Main Form
Create a main form that will have a group box and a list view.
- Create properties in the main form to access the user settings. Use these settings
to access the properties in the main form.
- Set the size and desktop location to the settings when the form loads.
- Dock the groupbox to the top. Add four buttons to the group box.
- Add Names: open the modeless dialog.
- Handle the dialog's event.
- When the event fires, add the name to the list view, as long as the name is not empty.
- Clear the name in the dialog after it is added to the list.
- Save Size: set the user setting for the size to the current size and save the settings
- Save Location: set the user setting for the location to the current desktop location and save the settings
- Reset Settings: reset the user settings to the original default values. Set the size and desktop location to the reset settings.
- Dock the list view so it fills the remaining available space in the form.
Submitting Homework
Zip your entire project and upload it on the web. Exclude the
Debug and Release directories.
Submitting
Homework Online.
Demo of the program.