7
Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to be the parent menu of that submenu All menu items can have Alt key shortcuts( also called access shortcuts or hot keys) This behavior can be established with property Mnemonic Hot key is specified by inserting an ampersand before the character in text property

Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to

Embed Size (px)

Citation preview

Page 1: Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to

Menus

Menus provide groups of related commands for windows applications

Menu, menu items, submenus A menu item that contains a submenu is considered to

be the parent menu of that submenu All menu items can have Alt key shortcuts( also called

access shortcuts or hot keys) This behavior can be established with property

Mnemonic Hot key is specified by inserting an ampersand before

the character in text property

Page 2: Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to

Create a menu

Open the toolbox, and drag a MainMenu control onto the form

To select the MainMenu, click on the icon This setup is known as the visual studio .NET

Menu Designer To add entries to the menu, click the type here

textbox and type the text. Each entry in the menu id of type MenuItem from

the System::Windows::Forms namespace. The menu itself is of type MainMenu

Page 3: Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to

MainMenu and MenuItem Event and properties Common MainMenu and MenuItem event

Click – generated when a menu or menu item is clicked, or when a shortcut key is used.

Common MainMenu properties MenuItems – represents the MenuItems that are

contained in the MainMenu RightToLeft –Causes menu text to display from right

to left. Useful for languages that are rad from right to left.

Common MenuItem Properties Checked – indicated whether a menu item is checked.

Default is false Index – specifies an item’s position in its parent menu

Page 4: Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to

Continued MenuItem properties

MenuItems – lists the submenu items for a particular menu item. Mnemonic – indicates the character associated with the menu

item. Provides only a get method; set mnemonic character by preceding it with an ampersand (&) in menu item’s Text property

RadioCheck- indicates whether a selected menu item appears as a radio button (true) or displays a check mark (false); default is false

Shortcut- specifies the short cut key for the menu item (e.g. Ctrl+F9 can be equivalent to clicking a specific item)

ShowShortcut – indicates whether a shortcut key is shown beside menu item text

Text – specifies the text to appear in the menu item. To create an Alt access shortcut, precede a character with &

Page 5: Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to

LinkedLabels

Displays links to other objects, such as files or web pages

It appears as underlined textLink can change color to indicate whether

the link is new, visited or active.When clicked, it generates a

LinkedClicked eventClass LinkedLabel is derived from Label

Page 6: Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to

Common properties

ActiveLinkColor – specifies the color of the active ink when clicked. Default is red

LinkArea – specifies which portion of text in the LinkLabel is treated as part of the link

LinkBehavior – specifies the link’s behavior, such as how the link appears when the mouse is placed over it.

LinkColor – specifies the original color. Blue Links – lists the LinkLabel::Link objects, which

are the links contained in the LinkLabel

Page 7: Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to

LinkVisited – if true, link appears as if it were visited. Default is false

Text – specifies the text to appear on the control

UseMnemonic – if true, &character in Text property acts