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

  Create the logic for a program that accepts input values

Create the logic for a program that accepts input values for the projected cost of a vacation and the number of months until vacation. Pass both values to a method that displays the amount you must save per month to achieve your goal

  Code the following methods:

Conversion from wet liters to wet pints and wet liters to wet gallons.step by step instructions to build interface and write code so that the progam can work in VB.NET.

  Create a visual basic application

Create a visual Basic application that asks the user for two different numbers through text boxes - Then compare the numbers to see which one is higher once they push a button.

  Create the control instances on the form

Please note that these are only suggestions and are not requirements. You are free to use your imagination to enhance the application. Two significant enhancements are required.

  Determine the output displayed in the text box

For each of the responses shown in the parentheses, determine the output displayed in the text box when the button is clicked

  Change the color of the text in the redlabel to red

Write that visual basic instruction to change the color of the text in the redlabel to red.

  Showing data from black friday sales including cost

I need a vb application in Microsoft Visual Studio showing data from black friday sales including cost, sales prices, transportation fees, profits, losses, best selling list, and worst selling list

  Write a program that uses an array of state objects

Write a program that uses an array of state objects and raises an event whenever the population density exceeds 10 million.

  Design for the gui application

Decide on an appropriate design for the GUI application which will be SELF Contained and allow the user to select and run the various calculations

  Shipping charge for the following zip codes

Need application code for visual basic should display the appropriate shipping charge. shipping charge for the following ZIP codes is $32: 60618, 60620, and 60632. All other ZIP codes are charged $37.75. Code the application in visual basic

  Prepare a problem on lottery number generator

Create an interface and develop an application for a Pick 3 Lottery Game. The application needs to show 3 randomly generated numbers based on a range of numbers provided by the users.

  Create web pages

What are some of the important features of these programs that assist a novice like Juan learn how to create web pages?

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