Page 212 - Open Soource Technologies 304.indd
P. 212

Event Driven Programming



                                        Shortcut keys appear automatically on the menu; therefore, you do not have to enter
                                        CTRL+key in the Caption box of the Menu Editor.


                          9.3 Separating Menu Items


                          A separator bar is displayed as a horizontal line between items on a menu. On a menu with many
                          items, you can use a separator bar to divide items into logical groups. For example, the File menu in
                          Visual Basic uses separator bars to divide its menu items into three groups, as shown in Figure 9.4.

















                                                       Figure 9.4:  Separator Bars.

                          9.3.1 To Create a Separator Bar in the Menu Editor
                            1. If you are adding a separator bar to an existing menu, choose Insert to insert a menu control
                               between the menu items you want to separate.
                            2. If necessary, click the right arrow button to indent the new menu item to the same level
                               as the menu items it will separate.
                            3. Type a hyphen (-) in the  Caption text box.

                            4. Set the  Name property.
                            5. Choose  OK to close the Menu Editor.


                                        Although separator bars are created as menu controls, they do not respond
                                        to the Click event, and users cannot choose them.



                          9.4 Creating Pop-up Menus

                          A pop-up menu is a floating menu that is displayed over a form, independent of the menu bar.
                          The items displayed on the pop-up menu depend on where the pointer was located when the
                          right mouse button was pressed; therefore, pop-up menus are also called context menus. In
                          Microsoft Windows 95 or later systems, we activate context menus by clicking the right mouse
                          button.




                          206                    LOVELY PROFESSIONAL UNIVERSITY
   207   208   209   210   211   212   213   214   215   216   217