Wednesday, December 12, 2012

difference between pull-down and pop-up menus


Pop up menu: This menu can be displayed anywhere on the page with a right-click of the mouse. It can be displayed anywhere on the Form.
Pop-up menus are invoked with the PopupMenu method. First, you create a menu as usual.
               PopupMenu menuname, flags, x, y, boldcommand
Only the first argument is required, and it’s the menu’s name, as shown in the Menu Editor window. The other arguments are optional. The x and y arguments are the coordinates of a point on the Form (or control) where the menu will be displayed. If you don’t specify the x and y arguments, the pop-up menu will appear at the pointer’s location. The flags argument defines the location and behavior of a pop-up menu. The last argument, BoldCommand, specifies the name of a menu command that should appear in bold. Only one command in the menu can be bold, and bold is commonly used to denote the default (or suggested) option.

CONSTANTS
DESCRIPTION

Location

vbPopupMenuLeftAlign
(default) The specified x location defines the left edge of the pop-up menu.
vbPopupMenuCenterAlign
The pop-up menu is centered around the specified x location.
vbPopupMenuRightAlign
The specified x location defines the right edge of the pop-up menu.
Behavior

vbPopupMenuLeftButton
(default) The pop-up menu triggers the Click event when the user clicks a menu item with the left mouse button only.
vbPopupMenuRightButton
The pop-up menu triggers the Click event when the user clicks a menu item with either the right or the left mouse button.


To specify both a behavior and location constant, combine them with the Or operator. The following code displays a pop-up menu with its top border centered on the Form, which triggers Click events for menu items when either button is pressed.
x = ScaleWidth / 2
y = ScaleHeight / 2
Form1.PopupMenu EditMenu, vbPopupMenuCenterAlign Or  vbPopupMenuRightButton, X, Y

Pull down Menu: This menu can be displayed when you click or bring mouse on menu then list of sub menu will be displayed under the main MENU. Pull down Menus can be created with Menu Editor.