Create a second-level item for the order menu

Assignment Help Visual Basic Programming
Reference no: EM131018040

The MenuStrip Control

Visual Basic forms can have menu bars similar to those in most Windows applications. Shows a typical menu, with the Order menu revealed. Here, the menu bar contains two menu items (Order and Color), referred to as top-level menu items. When the Order menu item is clicked, a dropdown list containing two second-level menu items (Ascending and Descending) appears. Although not visible here, the dropdown list under Color contains the two second-level menu items Foreground and Background. Each menu item is treated as a distinct control that responds to a click event. The click event is triggered not only by the click of the mouse button, but also for top-level items by pressing Alt + accesskey and for second-level items by just pressing the access key. The event procedure for the Ascending or Descending menu item also can be triggered by pressing the shortcut key combination Ctrl + A or Ctrl + D.

Menus are created with the MenuStrip control, which is usually the third control in the Menus & Toolbars section of the Toolbox. Each menu item has a Text property (what the user sees) and a Name property (used to refer to the item in the code.) The following steps are used to create the Order-Color menu:

1. Start a new project.

2. Double-click on the MenuStrip control in the Toolbox. The control appears in a pane below the Main area, and a menu designer appears just below the title bar in the Form designer.

3. Click on the rectangle that says "Type Here", type in the text &Order, and press the Enter key. (The ampersand specifies O as an access key for the menu item.)

"Type Here" rectangles appear below and to the right of the Order menu item. The rectangle below is used to create a second-level item for the Order menu. The rectangle on the right is used to create a new first-level menu item.

4. Type the text "&Ascending" into the rectangle below the Order rectangle, and press the Enter key.

5. Click on the Ascending menu item to display its Property window. In the Property window, change the name property of the menu item from AscendingToolStripMenuItem to mnuOrderAsc. Also, click on the down-arrow at the right of the ShortcutKeys setting box, click on the "Ctrl" Modifier check box, select "A" from the Key drop-down combo box, and then press the Enter key. (When the program is run, "Ctrl + A" will appear to the right of the word "Ascending".)

6. Type "&Descending" into the rectangle below the Ascending rectangle, set the Name property of the Descending menu item to mnuOrderDesc, and set the ShortcutKeys Property to Ctrl + D.

7. Click on the rectangle to the right of the Order rectangle and enter the text "&Color".

8. Type "&Foreground" into the rectangle below the Color rectangle, and set its Name property to mnuColorFore.

9. Type "&Background" into the rectangle below the Foreground rectangle, and set its Name property to mnuColorBack.

10. Click on the Foreground rectangle, and type "&Red" into the rectangle on its right. (We have just created a third-level menu item.) Set its Name property to mnuColorForeRed.

11. Type "&Blue" into the rectangle below the Red rectangle, and set its Name property to mnuColorForeBlue.

12. Click on the Background rectangle, type "&Yellow" into the rectangle on its right, and set its Name property to mnuColorBackYellow.

13. Type "&White" into the rectangle below the Yellow rectangle, and set its Name property to mnuColorBackWhite. Then set its Checked property to True. A check mark will appear to the left of the word "White."

14. Run the program; click on Order to see its menu items; click on Color and hover over the word Foreground to see its menu items. Each menu item has a Click event procedure. The menu items are only useful after we write code for the relevant event procedures.

Reference no: EM131018040

Questions Cloud

Construct the equation for kim budget line : If at the original prices, Darcie's marginal utility of another magnet is 40, and the marginal utility of another cheeseburger is 80, is she maximizing her utility? Given this information, construct the equation for Kim's budget line
Explain the circumstances of a breach of contract : Explain the circumstances of a breach of contract in your example, and discuss possible remedies.
Describe what the other neurotransmitters do : In the brain, most excitatory communication in synapses occurs by way of glutamate and most inhibitory communication occurs by way of gamma-aminobutyric acid. In general terms, describe what the other neurotransmitters do.
Turnball associates owned the following securities : Show the balance sheet presentation of the investments at December 31, 2015. At this date, Turnball Associates has common stock $1,509,700 and retained earnings $1,008,600.
Create a second-level item for the order menu : The rectangle below is used to create a second-level item for the Order menu. The rectangle on the right is used to create a new first-level menu item.
Explain the field of evolutionary psychology : Please explain the field of evolutionary psychology, focusing on the importance of the concept of natural selection. How does this research from evolutionary psychology apply to our daily lives?
Emitter bias current split between the two transistors : In a particular BJT differential amplifier, a production error results in one of the transistors having an emitter- base junction area that is twice that of the other. With the inputs grounded, how will the emitter bias current split between the t..
What is the shutdown price and what is the break-even price : Analyze the impact, both in the short run and in the long run, on the market equilibrium as well as firm C's profit-maximizing output level and total economic profit, due to the following respective changes.
Source of common-mode gain : If the only source of common-mode gain when the output is taken differentially is the mismatch in collector resistances, what must this mismatch be (in percent)?

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Applicaion for menu design

The user selects the Clear menu to clear the form.

  Under what conditions script is used

Create a script that uses the following components: an array, sub procedure, explicit declaration, RUNAT=Server, and a function.

  Store a reference to each form instance

Use VB.NET programming to write statement and copy in word document.

  If the sum or product of two positive integers

In C++, the largest int value is 2147483647. So, an integer larger than this cannot be stored and processed as an integer. Similarly, if the sum or product of two positive integers is greater than 2147483647, the result will be incorrect.

  Write a multiform program

Airplane Seating Chart An airplane has 15 rows (numbered 1 through 15), with six seats (labeled A, B, C, D, E, and F) in each row. Write a multiform program that keeps track of the seats that have been reserved and the type of meal requested by ea..

  Determine the output displayed when the button is clicked

Determine the output displayed when the button is clicked. Determine the output displayed when the button is clicked

  Write a program that displays the patterns separately

Write a program that displays the patterns separately, one below the other in a TextBox - Maximize your use of repetition and maximize the number of output statements.

  Performing a calculation on that value

Individual Visual Logic Calculations. Select two to three Each task must include the following Inputing a value. Performing a calculation on that value. outputting the value. produce Visual Logic files to execute each of these steps.

  Project related to vbscript

This course introduces basic programming concepts, logic, and scripting language tools used to automate basic system administrator processes. Critical thinking, logic, and troubleshooting are emphasized. Database applications are also introduced, ..

  Arrays write a program using dynamic arrays to record the

write a program using dynamic arrays to record the high temperatures of last ltbrgtseven days and to display all of

  Calculates the shipping charges for a package

Program Description: This project calculates the shipping charges for a package based upon a shipping rate of $0.12 per ounce

  Applications designed to perform basic math calculations

Test all operators with the values 8 and 2 to make sure it works as expected.what is different from the first case and fix the problem to handle the exception.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd