Sunteți pe pagina 1din 32

DEPARTMENT OF TECHNICAL EDUCATION

NDHRA PRADESH

Name of the faculty : G. Radha


Designation : Lecturer
Branch : CCP
Institute : 026 - SG Govt. Polytechnic, Adilabad
Year / Semester : III Year / V Semester
Subject : Visual Basic – I
Subject Code : CCP - 503
Topic : Understand Menus and Common
dialogue control .
Duration : 50 Mts.
Sub Topic : Designing a Menu.
Teaching Aids : Animations & Images

CCP-503.12 1
RECAP

 Menus and their features

CCP-503.12 2
Objectives :

Upon the completion of this period, you will be


able to understand about

• Creation of Menus at design time using menu design


window, in detail

CCP-503.12 3
Menu Editor

CCP-503.12 4
Menu Editor

• Menus are created on Form using the Menu Editor

• All the menu control design time properties are shown in


the menu editor

CCP-503.12 5
Important properties of Menu Control

 Name : This is the name of the menu item. It is


used to write code for a particular menu item

 Caption : This is the text that appears on the


application’s Menu bar

CCP-503.12 6
Menu Editor

CCP-503.12 7
Functions of Each Component in Menu
Editor

 Index : Used to create an array of Menu Commands.


All the commands of the array
have the same name and a unique
index that distinguishes them, just like array
of controls
 Shortcut : Shortcut Keys run a menu item
immediately when pressed. Frequently used
menu items are assigned a key board shortcut
CCP-503.12 8
Menu Editor

CCP-503.12 9
Functions of Each Component in Menu
Editor

 HelpContextID:
Determines an associated context number for an
object used to provide content – sensitive help

for your application

 NegotiatePosition :
Sets a value that determines whether or not
top level Menu controls are displayed on the
menu bar while a linked object or embedded
object on a form is active and displaying its
menus. Not available at run time
CCP-503.12 10
Menu Editor

CCP-503.12 11
Functions of Each Component in Menu
Editor

 Checked : Sets a value that determines whether a


check mark is added next to the menu
item

 Enabled : Sets a value that determines whether a


menu item can respond the events

 Visible : Used to make the menu items visible or


invisible
check it to make it visible

CCP-503.12 12
Menu Editor

CCP-503.12 13
Functions of Each Component in Menu
Editor
 WindowList : Used in MDI applications to maintain a
list of all open windows

 : This is used to reduce the indentation


level (Upper) of control

 : This is used to increase the indentation


level (Lower) of control

 : This is used to move the control (Up)


among the existing menu controls

 : This is used to move the control (Down)


among the existing menu controls
CCP-503.12 14
Menu Editor

CCP-503.12 15
Functions of Each Component in Menu
Editor
 Next : It is a button used to create another
menu control

 Insert : It is a button used to add a menu control


between existing controls

 Delete : It is used to delete an item from the menu


list

CCP-503.12 16
Functions of Each Component in Menu
Editor

 OK : It is used to close Menu Editor with


savings, when you have created all the
menu controls for that form

 Cancel : It is used to close Menu Editor without


saving

CCP-503.12 17
Menu Editor

CCP-503.12 18
Procedure to create a Menu using Menu
Editor
1. Open a new Form in design mode

3. Choose Tools (Menu) -> Menu Editor or Choose Menu


Editor on the Tool Bar

6. In the Caption “Text Box”, type the text for the Menu Title
that you want to appear on the Menu Bar

4. In the “Name” Text Box, type the name that you will use
to refer to the Menu Control in code

CCP-503.12 19
Procedure to create a Menu using Menu
Editor
1. Use the left arrow and right arrow buttons to change the
indent action level of the control

6. Set other properties for the control, if desired

7. Choose Next to create another menu control


Or
Use the Insert button to add a Menu Control between
existing controls
Or
You can use the Up arrow and down arrow buttons to
move the control along the existing menu controls

CCP-503.12 20
Procedure to create a Menu using Menu
Editor

1. Choose OK to close the Menu Editor when you have


created all the Manu Controls for that Form

9. The Menu titles you create are displayed on the Form.

10. Click a Menu title to drop down its corresponding


menu items

CCP-503.12 21
Example to create a Menu using Menu
Editor
1. Open a new Form in design mode and chose Tools ->
Menu Editor in the Tools Menu

2. In the Caption Box, type the Caption of the first


command

3. In the Name Box, enter the command’s name


(MnFile)

CCP-503.12 22
Example to create a Menu using Menu
Editor

4. Press Enter or Next button to enter the


Command.

5. Repeat the steps 2 and 3 for all the commands

listed in the table given below

CCP-503.12 23
Example to create a Menu using Menu
Editor
Caption Name
File Mnfile
….Open MnOpen
….Save MnSave
….Exit MnExit
Edit MnEdit
….Copy MnCopy
….Paste MnPaste
….Cut MnCut

Now run the application to see the menu and its position.

CCP-503.12 24
Menu Editor Ex.

CCP-503.12 25
Menu Editor at Run time

CCP-503.12 26
Menu Editor at Run time with File Menu
opened

CCP-503.12 27
Menu Editor at run time with Edit menu
opened

CCP-503.12 28
Summary

 Creation of Menus at design time using Menu


Editor Window in detail

CCP-503.12 29
Quiz
1. _______ button is used to add a Menu Control
between existing controls in Menu Editor

A) Next
B) Insert
C) Delete
D) Last

CCP-503.12 30
1. _______ button is used to create another Menu
Control in Menu Editor

A) Next
B) Insert
C) Delete
D) Previous

CCP-503.12 31
Frequently Asked Questions

1. Explain in detail the function of each component


in Menu Editor

• Explain the procedure for creation of Menu at


design time using Menu Editor

CCP-503.12 32

S-ar putea să vă placă și