Analysis of simple function buttons in C ++ Builder

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.