Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using C# and including comments: Create a windows “forms app (.NET framework)” .

ID: 3598975 • Letter: U

Question

Using C# and including comments:

Create a windows “forms app (.NET framework)” . Name the project and the solution the same.

Note: Unfortunately I don’t think you can do this on a Mac. I’m willing to work with you to try, but this type of project may not be available in the Mac version of Visual Studio.

Set up the visual part of the app for this lab. The app will look like this when it starts up:

Once the project is created, follow these steps to create the visual part of the app:

Manipulate the Form’s properties

Change the text property of the Form to “My Notepad”. Change the Font property to 9pt Segoe UI.

Add a MenuStrip control to the Form

Add a MenuStrip to the Form. After inserting the MenuStrip, add items by clicking the Type Here section, typing a menu name (for example: File, Edit, View and About) and then press Enter.

Add a RichTextBox to the Form

Drag this control onto the Form.
Use the sizing handles to resize and position the RichTextBox as shown above.
Change the Text property to “Enter text here”.

SubMenu Structure

Give your MenuStrip the following submenu structure:

Add a command to the Exit Menu Item

Double click on the Exit Menu Item, and add the following statement to the method you are placed into:

When you run the program, your Exit Menu Item should work now. Really, that’s all it takes!

My Notepad File Edit View About Enter text here

Explanation / Answer

//------- CODE ---------//

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace lab_171022
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close(); // event handler for the exit menu item
        }
    }
}

/* directions

1) Follow the instructions in the question to place the menu strip, sub-menus and rich text box on the form and change their properties.

2) Right click on a sub-menu item and select insert separator to add the separator lines.

3) Double click "Exit" and write the Close() method in the call back handler function presented.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote