PART II
C h a p t e r 2 6 :
U s e S y s t e m . W i n d o w s . F o r m s
859
Adding a Menu
The main window of nearly all Windows applications includes a menu across the top. This
is called the
main menu.
The main menu typically contains top-level categories, such as File,
Edit, and Tools. From the main menu descend
drop
-
down menus,
which contain the actual
selections associated with the categories. When a menu item is selected, a message is generated.
Therefore, to process a menu selection, your program will assign an event handler to each
menu item. Because menus are such a bedrock resource in Windows programming, many
options are available and the topic of menus is quite large. Fortunately, it is easy to create a
simple main menu.
Originally, there was only one way to create a main menu: by using the classes
Do'stlaringiz bilan baham: |