Usage of excellent menu control devexpress bar

Source: Internet
Author: User

Usage of excellent menu control devexpress bar

Some time ago, when I was working on a project, I used develper experss Inc. the devexpress bar control is really a good thing. It can completely replace the existing Menu Control and Toolbar Control of Delphi. Its functions are also the best among the third-party controls. Therefore, I would like to write my own income and experience here, hoping to help you.

After devexpress bar is installed, the expressbars page is added to the control bar:


We mainly use the second dxbarmanager control. Here, we will create an application with menus and shortcuts as an example.


Create a project and place it on form1


Double-click the control to display the setting window (for example ). All settings are completed in this window.


As you can see, the setting window is divided into several tab pages for different settings. The purpose of the toolbars page is to set different toolbar. To create a menu and a shortcut toolbar, click "new" () and add two toolbars named menubar and fastbar respectively.


Setting window after adding


You can note that after adding a toolbar, two floating toolbar appear on form1. This is what we just added. It has the floating function, and the initial status is floating:


Place the cursor over the toolbar, press and hold the left button, and move it to any edge of the form. We will dock menubar to the top, and fastbar To the bottom of menubar:


This is just an empty shell. Next, we will add the menu: double-click the dxbarmanager control to open the commands page, right-click on the right, and the menu will pop up. Select Add.


In the pop-up window (), select tdxbarsubitem for type, which is a container that can hold buttons of other types. Caption is set as the title. Set it to "File"


After confirming, we can see that it is added to command:


However, it is not added to the form. Click "file" in the left mouse, hold it down, and drag it to the menubar of form1: (during the drag process, the mouse shape is an X in the lower right corner of a small rectangle, when it is moved to a position that can be placed, X becomes +, indicating that it can be added)


Next, add the buttons Under "File. Or right-click on the right side of the command page,


Type does not need to be changed, and caption is set to new. After confirmation, new appears in commands. Select New and drag it to the menubar file on the form. When the file is dragged, the file is automatically opened and new is placed in the blank area. The result is shown in the right figure.


Similarly, you can add other menu items, such as save, save as, and close.

After the file is processed, you can add the edit and other menus. In this way, the menu is built. The next step is to create a shortcut toolbar.

Similarly, double-click the dxbarmanager control, open the commands page, right-click, and select Add. However, select tdxbarlargebutton for the type. After confirming, drag it from the commands page to fastbar:




A shortcut is ready. Add others.

You can see that the shortcut button does not have an icon, Which is ugly. Solve it: add an imagelist, add the corresponding image to it, select dxbarmanager1, set its largeimages attribute to the newly added imagelist, and click the Save button in, you can select the icon in the drop-down Bar of largeimageindex.

You can also set the icon for the menubar project: add an imagelist, add the corresponding image to it, select dxbarmanager1, and set its images attribute to the imagelist you just added, click "file" in the ", and then select" new "in the pop-up menu to select the icon in the imageindex drop-down bar.


In this way, the interface of an application containing menus and shortcuts is almost the same. The rest is to write code in The onclick (or other) event of each button.


To sum up, the simple development process of the dxbarmanager control is:

1. Generate Each toolbar on the toolsbar page;

2. Drag and Drop Each toolbar to a proper place;

3. Add various buttons to the command page;

4. Drag and Drop buttons in appropriate places (such as in toolbar or other containers, such as tdxbarsubitem)

In fact, the dxbarmanager control not only provides tdxbarbutton and tdxbarlargebutton, but also provides buttons for various lists, images, and fonts, in the same way, you only need to drag and drop the commands page of The dxbarmanager control. Of course, you also need to set their own attributes before use.


This article only briefly describes the use of the dxbarmanager control, hoping to serve as a reference, and hope to be criticized and corrected by friends. If you have any questions, welcome to discuss: (Welcome to reprint, but the author retains the copyright)


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: 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.