Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the simple function button in C++ Builder

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

The knowledge of this article "how to achieve the simple function button in C++ Builder" is not understood by most people, so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to achieve simple function button in C++ Builder" article.

Like menus in C++Builder and C++, use it to further enhance the application's menu interface. Generally speaking, function button menus and down menus are inseparable. The function button menu contains function buttons, which are quick access to the most commonly used commands in the application. We have seen many function button menus, such as the function button menu of IE below.

In C++Builder, a simple function button menu can be made by using a function button control (TToolBar) and an image list control (TImageList). Generally speaking, there are four steps:

(1) insert the appropriate image in the TLmageList control

(2) set the Images property of the TToolBar control to TlmageList

(3) add TButton to TToolBar by right-clicking and customize it through the property page.

(4) add relevant actions to the TToolBarClick event.

To make IE-style function button menus, you need to use TCoolBar or TControlBar controls. There are three ways to make IE-style function button menus. We will now explain them with examples.

I. TCoolBar+TToolBar+TImageList

Step 1: create a new project and add a TCoolBar and a TImageList control to the Form. Then add a TToolBar control to TCoolbar. Set the Align property of TCoolbar to alTop. Adjust the height of TToolBar, and then set the AutoSize property of 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, select 'New Button'' from the pop-up menu to insert TButton, and select 'New Seperator'' to insert the splitter bar.

Step 4: if the Images property of the TToolBar control is set to ImageList1 in C++Builder, the icon in the TImageList control immediately appears in the tool button menu.

Step 5: double-click any button in the function button menu with the mouse, and you can write processing code for the event response of this button.

The above is about the content of this article on "how to achieve simple function buttons in C++ Builder". I believe you all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more related knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report