Toolbar with Delphi to achieve wind Word97 style

zhaozj2021-02-11  254

In Delphi's component option board Additional page, the ControlBar element is added, and the Toolbar in this component and Win32 page is used in conjunction with the components of ImageList, MainMenu, etc., which fully enable the toolbar with Word97 style. The following is an example of a toolbar in a form, detail the design steps:

1 Select ControlBar from Additional Page, put it in Form1, set its properties as follows: Allign: = altopautosize: = trueBevelkind: = BKNENE

2  Select Toolbar from the WIN32 page, put it on the Controlbar, adjust the Toolbar position, allow it to set the left, adjust its width, set the properties edgeborders: = [], flat: = true. Right to Toolbar with your mouse, select NewButton on the floating menu, repeat several, design the desired button.

3 Select ImageList components from WIN32, design the main menu for the Form1, the main menu design method is Delphi2, Delphi3. After designing the main menu, set its properties AutoMerge to True.

4 Finally, each button is assigned a Name value of TMENUITEM, set the MenuItem property value of each button to the Name value of the desired menu.

Press F9 to run the program, it can be found that the designed toolbar has a Word97 style. With the mouse to move on each button, the button is automatically floated, click the mouse, and pop up the corresponding menu. It should be noted that the property Automrge is set to TRUE, which is not to let the main menu appear on the top of Form1. The toolbar design must be used in conjunction with Toolbar, otherwise do not get the same toolbar as Word97 appearance.

转载请注明原文地址:https://www.9cbs.com/read-4216.html

New Post(0)