In the Additional page of Delphi's component palette, a new Controlbar component is added. This component is used in conjunction with the Toolbar and Coolbar in the Win32 page, and supplemented by components such as Imagelist and Mainmenu, it is possible to implement a Word97 style toolbar. The following takes a toolbar in a FORM as an example to introduce the design steps in detail:
1. Select Controlbar in the Additional page, put it in FORM1, and set its properties as follows: Allign:=altopAutosize:=trueBevelkind:=bknone
2. Select the Toolbar on the Win32 page, place it on the Controlbar, adjust the position of the Toolbar so that it is placed at the far left, then adjust its width, and set the properties Edgeborders:=[], Flat:=TRUE. Right-click the Toolbar with the mouse, select Newbutton on the floating menu, and repeat several times to design the required buttons.
3. Select the Imagelist component in the Win32 page and design the main menu for FORM1. The design method of the main menu is the same as that of Delphi2 and Delphi3. After designing the main menu, set its property Automerge to TRUE.
4. Disadvantages: Each button is assigned the Name value of Tmenuitem, and the Menuitem attribute value of each button is set to the Name value of the desired menu.
Press F9 to run the program, and you will find that the designed toolbar already has the style of Word97. Move the mouse over each button, and the button will automatically float up. Click the mouse, and the corresponding menu will pop up. It should be noted that the Mainmenu attribute Automerge is set to TRUE in order to prevent the main menu from appearing at the top of FORM1. The design of the toolbar must combine the Controlbar and Toolbar, otherwise you will not get a toolbar with the same appearance as Word97.