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

  Write paper on creating and accessing arrays

Write a 2 page research paper (excluding the title page) on creating and accessing arrays. Explain the concepts discussed in the textbook using at least one example not included in the textbook

  Write a loop in pseudocode or visual basic

Write a loop in pseudocode or Visual Basic to print the integers from 10 to 100 counting by 10s

  Remove minimize, maximize, and close buttons from the title

Perform the appropriate steps to create a connection to the sample database. Be sure to select the option to copy the database to your project so it will be automatically included in the project.

  Assignment onnbspvisual basic nbsptechnical project

assignment onnbspvisual basic nbsptechnical project designing vb applications across multiple platforms this assignment

  Create windows form that prompts user survey responses

Write a GUI program that reads a five-letter word from the user and produces all possible three letter combinations that can be derived from the letters of the five-letter word.

  Accept data regarding the purchase of fruit

Continually accept data regarding the purchase of fruit until a sentinel value is entered. Prompt the user for each item, and accept the name of the fruit (e.g., "dried apples"), the price per pound, and the number of pounds sold in a month

  Visual basics program to calculate and display charges

Assume that no car parks for longer than 24 hours at a time. Write a visual basics program that calculates and displays the parking charges for each customer who parked a car in this garage.

  Design the logic for a program allows a user to enter number

Design the logic for a program that allows a user to enter 15 numbers, then displays each number and its difference from the numeric average of the numbers entered.

  What kind of hardware it runs on and tied in

Conclude with a few sentences providing your own personal overall evaluation of the software and why you make this assessment

  Create user interface similar to one pictured in this link

Use a second group of RadioButton controls to select whether a student handed in the assignment on time, with the default being

  About vbs script

Write at least one non-trivial paragraph that explains in detail either a significant problem you had and how you solved it, or, if you had no significant problems, something you learned by doing the exercise.

  Design a program that asks user to enter number of packages

Design a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount.

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