Reference no: EM132324237
Assignment - Exercises for Murach's Visual Basic - Create an MDI application
In this exercise, you'll create an application with a multiple-document interface that consists of a parent form and two child forms.
Open the project and add a parent form
1. Open the CalculateFlooringCosts project in the CalculateFlooringCostsMDI directory. Then, review the code for the Carpeting Costs and Hardwood Costs forms so you understand how they work.
2. Add a form to the project, and set the IsMdiContainer property of this form to True to identify it as the parent form. Resize the form so it's large enough to hold several child forms, and use the Application page of the Project Designer to change the startup form to the new form.
Add the File menu to the parent form
3. Add a MenuStrip control to the parent form. Then, use the Menu Designer to add a File menu to the parent form. This menu should include four menu items that display a Carpeting Costs form, display a Hardwood Costs form, close the active child form, and exit from the application. Give each menu item an appropriate name, include access keys for the menu and menu items, and include a separator bar between the Close and Exit items.
4. Add an event handler for the Click event of each item in the File menu. The event handlers for the New Carpeting Costs and New Hardwood Costs items should create a new instance of the appropriate form, set the parent form to the current form, and display the form. The event handler for the Close item should close the active child form, if there is one. And the event handler for the Exit item should exit from the application.
5. Change the Exit buttons on the Carpeting Costs and Hardwood Costs forms to Close buttons, and change the StartPosition property of these forms to WindowsDefaultLocation.
6. Test the application to be sure that the items in the File menu work as expected.
Add the Window menu to the parent form
7. Add a Window menu to the right of the File menu. Then, add three items to this menu that will let the user arrange the forms in a cascaded, vertical, or horizontal layout.
8. Give each item in the Window menu an appropriate name, and then add an event handler for the Click event of each item that arranges the child forms appropriately.
9. Set the MdiWindowListItem property of the menu strip so the Window menu will display a list of the open child forms.
10. Test the application to be sure that the items in the Window menu work as expected.
Add a toolbar to the parent form
11. Add a ToolStrip control to the parent form. Then, add two buttons to this toolbar with the text "Carpeting Costs" and "Hardwood Costs" on them. Be sure to assign appropriate names to these buttons.
12. Add an event handler for the Click event of each button that uses the Click event handler for the associated menu to display the form.
13. Test the application to be sure that the toolbar buttons work.
Add a status bar to the parent form
14. Add a StatusStrip control to the parent form. Then, add a single ToolStripStatusLabel control to the status bar.
15. Add a module-level variable to the parent form to store the count of child forms, and give this variable an initial value of 0. Add code to increase or decrease the value of this variable each time a new form is opened or closed.
16. Add a procedure named DisplayFormCount that sets the Text property of the ToolStripStatusLabel control to "Number of child forms currently displayed: " appended with the current form count. Then, add code to call this procedure when the form is loaded and each time the form count changes.
17. Test the application to be sure that the form count is displayed properly.
Add tooltips and context-sensitive help to the child forms
18. Add a ToolTip control to each child form. Then, add a tooltip for each text box, check box, and radio button on these forms. For the check box and radio buttons, you should display the cost associated with selecting that control.
19. Add a HelpProvider control to each child form. Then, add context-sensitive help for the Area text box on each form that explains how to calculate the area (length in feet x width in feet).
20. Add context-sensitive help for each form that describes what the form does.
21. Test the application to be sure that the tooltips and context-sensitive help are displayed.
Attachment:- Assignment Files.rar