TAILIEUCHUNG - Developer’s Guide Borland Delphi 7 for Windows PHẦN 3

Bạn có thêm một thành phần menu để mẫu của bạn, hoặc các hình thức, đối với mỗi trình đơn bạn muốn bao gồm trong ứng dụng của bạn. Bạn có thể xây dựng cấu trúc menu mỗi hoàn toàn từ đầu, hoặc bạn có thể bắt đầu từ một trong các mẫu menu được thiết kế trước. | Creating and managing menus Building menus You add a menu component to your form or forms for every menu you want to include in your application. You can build each menu structure entirely from scratch or you can start from one of the predesigned menu templates. This section discusses the basics of creating a menu at design time. For more information about menu templates see Using menu templates on page 9-41. Naming menus As with all components when you add a menu component to the form the form gives it a default name for example MainMenul. You can give the menu a more meaningful name that follows language naming conventions. he menu name is added to the form s type declaration and the menu name then appears in the Component list. Naming the menu items In contrast to the menu component itself you need to explicitly name menu items as you add them to the form. You can do this in one of two ways Directly type the value for the Name property. Type the value for the Caption property first and let Delphi derive the Name property from the caption. For example if you give a menu item a Caption property value of File Delphi assigns the menu item a Name property of Filel. If you fill in the Name property before filling in the Caption property Delphi leaves the Caption property blank until you type a value. Note If you enter characters in the Caption property that are not valid for Delphi identifiers Delphi modifies the Name property accordingly. For example if you want the caption to start with a number Delphi precedes the number with a character to derive the Name property. The following table demonstrates some examples of this assuming all menu items shown appear in the same menu bar. Table Sample captions and their derived names Component caption Derived name Explanation File File1 Removes ampersand File 2nd occurrence File2 Numerically orders duplicate items 1234 N12341 Adds a preceding letter and numerical order 1234 2nd occurrence N12342 Adds a number to .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.