Similar to the menus in C ++ Builder and C ++, you can use them to further enhance the menu interface of the application. In general, the functional button menu is inseparable from the down menu. The function button menu contains the function button, which is a quick access to the most common commands in applications. Many functional button menus are not uncommon. The functional button menus of IE are as follows.
In C ++ Builder, to create a simple function button menu, you only need to use the function button control TToolBar) and an image list control TImageList. Generally, four steps are required:
1) insert an appropriate image in the TLmageList Control
2) set the Images attribute of the TToolBar control to TlmageList.
3) Right-click the button to add TButton to the TToolBar and customize it on the properties page.
4) add related operations to the TToolBarClick event.
- Describes how to learn C ++ programming in Linux
- C ++ Programming
- C ++ programming examples
- Several important elements of C ++ programming tools
- In-depth analysis of various problems with C ++ development tools
The TCoolBar or TControlBar controls must be used to create an IE-style function button menu. There are three methods available. Now we will use the example to explain how to create the IE-style function button menu.
I. TCoolBar + TToolBar + TImageList
Step 1: Create a project and add a TCoolBar and a TImageList control to Form. Then add a TToolBar control to the TCoolbar. Set the Align attribute of TCoolbar to alTop. Adjust the height of the TToolBar, and set the AutoSize attribute of the TToolBar and TCoolBar controls to true;
Step 2: Right-click the TImagelist control, open the 'imagelist editor' window, and add the corresponding copy, cut, and paste icons.
Step 3: Right-click the TToolBar control and select New Button in the pop-up menu to insert TButton. Select New Seperator to insert the split bar.
Step 4: Set the Images attribute of the TToolBar control to ImageList1 in C ++ Builder, then the icons in the TImageList control immediately appear in the tool button menu.
Step 5: Double-click any button in the menu of the function button to write the processing code for the event response of this button.