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

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms". This assignment will contain two (2) Parts: Written Paper and Visual Basic Prototype. The Visual Basic Prototype is not included in the total page count but is included in the e..

  Visual basic programming discussion

The use of decision logic is one of the major concepts of computer programming. The decision takes your code from being sequential to one that can take various options based on the different conditions. Determine the method of coding that you would u..

  Ticketseller

Use Visual basic 2010Visual Basic,  TicketSeller. This assignment will contain two (2) Parts: Event Planning Document and Coding phase. You must submit both parts as separate files for the completion of this assignment. Remember, you are only to de..

  Data storage & "exception error trapping"

Discussion on Data Storage and  "Exception Error Trapping".

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms".

  The implementation of server side of the application

Implementation of dynamic content, server side (backend) and database for your web site using Microsoft Visual Studio 2012

  Need help building a vwd website

Need help building a VWD website. This website may not go live. I have little progress as a family tragedy has impeded my time for school.

  To develop a visual basic console application

The aim of the assessment is to develop a Visual Basic console application that performs a number of mathematical functions. The mathematics package will be menu driven, i.e. a number of options will be displayed, and the user will be able to input w..

  Program in basic which prompts user to input two integers

Write down the program by using Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).

  Develop vb-net application that includes arrays and loops

Develop a VB.NET application that includes arrays, loops, and IF statements to do the following. Your output must also display the number of applicant(s) being interviewed.

  Visual basic program to accept numeral values

Write a VISUAL BASIC program to accept numeral values of any unit, sum up the total, calculate the average, and then Output the result with a proper unit.

  Write a visual logic program to accept series of number

Write a Visual Logic program which accepts a series of numbers, until the first negative value is entered. The maximum number of non-negative input values is 250.

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