"Go" implements ribbon-style forms

Source: Internet
Author: User

With the rise of office2007, Microsoft let us see the ribbon-style form, and now many software are beginning to use the Ribbon style.
So if we want to develop ourselves, what should we do? This article is for everyone to solve this mystery.

First of all, Delphi itself does not have a ribbon-style window can be directly used, and many of the market is similar to the Ribbon style is done by the usage, that is cumbersome, and the control of the picture is very high. This is undoubtedly an increase in the cost of the software, the method described here is the use of third-party controls, DevExpress Bar 6来 complete the ribbon-style interface.

First download and install DevExpress Bar 6, note must be 6, previous version does not have ribbon style, then install it into Delphi2007. The next step is to get to the chase.

The necessary controls are described:

Tdxribbon and Tdxribbonstatusbar can be seen directly on the interface;

The Tdxbarmanager is used to create the Barmanager property of the Toolbar,tdxbarmanager corresponding Dxribbon, and the toolbar corresponding to the parent control's group property is created;

Tdxbarapplicationmenu is used to create a Project menu, a Tdxribbon contains only one tdxbarapplicationmenu, corresponding to the Applicationbutton.menu attribute of Tdxribbon;

Tdxbarscreentiprepository for creating a button, creating a hint that corresponds to the ScreenTip property of a button, and other controls

1. Drag and drop the necessary controls to set the corresponding properties:

The above controls are required for the ribbon, and they are all dragged onto the form. Drag on the interface, you can see that the Ribbon tab has been shown, but it is not the effect we want. Next, continue to set the properties of the control.
Set the Barmanager property of Dxribbon to the Dxbarmanager control, and set the Dxribbonpopupmenu Ribbon property to Dxribbon control. Double-click the Dxbarmanager control, and then create a new toolbar.

  

2. Add Applicationmenu

Then an extra toolbar is given in the object inspector, with the name Dxbarmanager1bar1. Set the Quickaccesstoolbar.toolbar property of Dxribbon to Dxbarmanager1bar1 and immediately see that the Applicationmenu has been shown.

3. Add toolbar for Application and tab

Right-click on the small arrow to the right of Applicationmenu and add a few buttons. Then double-click Dxbarmanager, add toolbar, right-click on Dxribbon, select Tabs Editor, and in the pop-up window, choose tab. Double-click the Groups property, add a group, and then associate the new toolbar with the group. The resulting program interface

Now run the program to see the effect

4. Remove the title bar

It's pretty much the effect, but unlike office2007, we have to remove the title bar and let the title bar appear in the Ribbon. This place needs a little skill. Press F12 to switch to Code view, add a dxribbonform reference under uses, and modify the base class of the form from Tform to Tdxribbonform. Set the Supportnonclientdrawing property of the Dxribbon control to True. Run the program again.

5. Add content for Application

Now see the effect is the Ribbon, but applicationmenu point down or there is no thing, we want to add a menu under Applicationmenu. Set Dxribbon's Applicationbutton.menu property to Dxbarapplicationmenu, double-click the Itemlinks property of the Dxbarapplicationmenu control, and a small window will be found at the top left of the screen, which is used to make the app Licationmenu, add buttons and groups to the inside.

Run the program again and click on the circular pattern in the upper left corner to see the Applicationmenu.

6. Add ScreenTip hint message for button

Double-click Tdxbarscreentiprepository, create a new ScreenTip (Name=dxscrntpopen), and then set the ScreenTip property of the Open button to Dxscrntpopen

"Go" implements ribbon-style forms

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.