Visual Basic .NET

A VB .NET Menu Project

This tutorial assumes that you have been following along from the

This tutorial assumes that you have been following along from the

Add the following MainMenu items to the menu bar you
have already designed in this section:

  1. Edit
  2. View

On your Edit Menu, place the following menu items:

  • Undo
  • Cut
  • Copy
  • Paste

On your View Menu, place the following menu items:

  • View Textboxes
  • View Labels
  • View Image

Just like you did with the Exit menu item, Change the Name property of ALL
menu items. Do not leave them on the defaults of “MenuItem1”, “MenuItem2”,
etc. (You should change the Name property to something relevant, and use the
prefix mnu. For example, the Undo item could have the Name mnuUndo.)

  • Add an underline shortcut for ALL menu item
  • Add a least one key combination shortcuts per drop down menu (you already
    have one on the File menu, so this doesn’t count)

When you have finished, your menus should look like these (though you can use
different key combinations, if you like):

Edit Menu

The Edit Menu

View Menu

The View Menu

  • Write code to display a message box whenever a menu item is clicked, or
    its shortcut used. The message box should explain what the menu item will
    do when it’s fully implemented.

There’s only one line of code to write for each menu item. You can get at the
code for the click event of each menu item in exactly the same way that you
did for the Exit menu item.

Good Luck!

In the next part, you’ll learn how to write code for all your new menu items.
We start with the Open menu item.

Kaynak : https://www.homeandlearn.co.uk/NET/nets4p5.html ‘sitesinden alıntı

Yorum Yap