How to add and use a menu control on the form develop a


Lab Assignments

Objectives

In this lab assignment, students will learn:

- How to add and use a menu control on the form

- How to write data in the sequential file

- How to read data from a sequential file

Goals

In this lab assignment, students will demonstrate the abilities to:

- Add and use a menu control on the form

- Write data in the sequential file

- Read data from a sequential file

Grading

- Design and create a GUI

- Create correct event handler methods

- Write data to a sequential file correctly

- Read data from a sequential file correctly

- The program can be compiled and executed without error

Develop a "Grade Report" project, which allows user to

Create a sequential file or open an existing file, then save test scores in this file.

Open an existing sequential file, and read test scores from this file.

This is the GUI in the design view. Add a menu "File" on the form, which has three menu items: New, Open and Close.

When start to run this project, only "New" menu item is enabled, all other controls are disabled.

Click "New" menu item, the "Save As" dialog box will be opened, user will create a new .txt file or open an existing .txt file.

After click "Save" button in the "Save As" dialog box, the "Close" menu item will be available. All input textboxes, "Submit" button and InputGradeListbox will be enabled.

Input test scores , then click "Submit and Save Grades" button, the input grades will be displayed in the "inputListbox" and also saved in the .txt file created in step 3. You should only save the grades in the file, one record a line, separated by ",", do not type title or header.

If there are no more grades to submit, click the "Close" menu item, then all controls are disabled except for "Open" menu item.

Now click the "Open" menu item, the "Open" dialog box is opened, user will select the file used in step 5 and open it.

Now the "Read and Display All Grades" button and ReadGradeListBox are enabled.

Click the "Read and Display All Grades" button, all grades will be read from the file and displayed in the ReadGradelistbox at bottom on the form.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: How to add and use a menu control on the form develop a
Reference No:- TGS01673217

Now Priced at $35 (50% Discount)

Recommended (95%)

Rated (4.7/5)