COP4226, Assignment 1
Due Tuesday, January 30 at 11:59 pm.
Zip your entire project and upload on the web. Exclude the
Debug and Release directories.
Submitting
Homework Online.
Create a forms based application.
Application Context
-
Create an enumeration type with three values for local,
application and none.
-
Create an application context class for this application. Use it to run the
program.
-
Add a member variable to the context, whose type is the enumeration type.
Give the variable a default value from the enumeration.
-
Create a read-only property for the variable in the context.
-
Before running the context, display a modal dialog box with three
radio buttons, an OK button and a Cancel button.
-
Each button corresponds to one of the values in the enumeration. When the
button is clicked, set a member variable in the dialog class to the corresponding
value from the enumeration.
-
Choose one of the radio buttons as the default value (check it).
-
Create a read only property for the member variable in the dialog.
-
If the user clicks OK, copy the property from the dialog into the member
variable in the context. If the users clicks Cancel, then do not change the
member variable in the context.
-
After the context has stopped running the main form, display a message box
that has two buttons: Yes, No. If the user clicks Yes,
then create a new main form and run the context again. If the user clicks
No, then allow the program to end.
-
Repeat this process every time the context stops running the main form.
-
Do not open the dialog with the radio buttons each time. That dialog should
only be opened once, before any of main forms are created.
Control Library
-
Add a control library to the solution.
-
Add a control to the library that contains your full name. Use a new font,
size and color for your name.
-
Add a control to the library that contains the course and section. Use the
same font and color as was used for your name.
-
Make the size of the course smaller than the size of the name.
-
Make the size of the section smaller than the size of the course.
Form
-
Center your name, from the control library, at the top of the form. When
the form is resized, the name should remain centered.
-
Add an image resource to the application resources.
-
Add an image to the main form's resources.
-
When the form is created, read the property from the application that contains
the enumerated value that was chosed when the application started. Set the
background image of the form based upon the value of this property.
-
Application: set the background image to the resource that you added to the
application resources.
-
Local: set the background image image of the form to the local resource that
you added to the form's resources.
-
None: do not set a background image.
-
Add a menu to the form. Add a top level menu named Help.
-
Add a menu item named Oath to the Help menu. When clicked, display a new
modeless form.
-
Add a menu item named About to the Help menu. When clicked, display a new
modal form.
-
Position the window below the main window: the bottom border of the
main window should abut the top border of the new window; the left borders
of the windows should be at the same distance from the left edge of the screen.
-
The new form may not access any properties of the main form.
-
Center the user control for the name at the top of the form.
-
Center the user control for the course and sectionbelow the name.
-
Add a multiline label that describes this assignment.
-
Add a text box to the menu that contains the number of pixels that will be
used to resize and reposition the form.
-
If there is a format exception, set the number of pixels to a default value,
of your choice, between 1 and 9.
-
If there is an overlow exception, set the number of pixels to a maximum that
is ten times the default value defined above.
-
The user may enter a negative number, which will cause the buttons to operate
in the opposite direction.
-
If the number that is entered is greater than the maximum, then set it to
the maximum.
-
If the number that is entered is less than the negative of the maximum, set
it to the negative of the maximum.
-
Add four buttons to the form. Anchor them to the lower right corner of the
form.
-
Set the minimum size of the form so that all the buttons are visible.
-
One button will increase the height and width of the form by the number of pixels in the menu text box. When
this button resizes the form, do not allow the border of the form to go beyond
the edge of the screen.
-
One button will decrease the height and width of the form by the number of pixels in the menu text box. When
this button resizes the form, do not allow the form to become smaller than
the minimum size.
-
One button will increase the location of the form by the number of pixels in the menu text box (X and Y).
When this button moves the form, do not allow the border of the form to go
beyond the edge of the screen.
-
One button will decrease the location of the form by the number of pixels in the menu text box (X and
Y). When this button moves the form, do not allow the border of the form
to go beyond the edge of the screen.
-
When the user leaves a button pressed, the action of the button should be
repeated every 2 seconds. Do not allow the button to dissappear from the
visible area as a result of the repeated resizing and repositioning.
-
Each button can be dragged to a new location in the form, using the mouse.
Dragging will occur as long as the button is in the pressed position. Resizing
and repositioning will also occur while the drag is in progress.
-
Add a notify icon to the form.
-
Add a context menu to the notify icon that has four options. Each option
will do one of the actions of the buttons in the form. Each button does a
different action.
-
Create an icon for the notify icon that contains your initials.
-
When the form is deactivated, make the form partially transparent. When the
form is activated, make the form opaque.