This example makes a toolbar that can be automatically scrolled.
Add a timagelist component to the form and add several image files to it. Then add a Ttoolbar component, set the Ttoolbar component's images property to the Timagelist component, right-click on the Ttoolbar component, select the New button item in the pop-up shortcut menu, add a few buttons for the Ttoolbar component, and set the ImageIndex property of the button to correspond to the image index number in the Timagelist component respectively. Finally, add a Tpagescroller component to the form, set its AutoScroll property value to True, set the control property to the Ttoolbar component, and if the Ttoolbar component is larger than the size of the Tpagescroller component, A button is displayed.
The design-completed form is shown in Figure 1.
Figure 1 Main interface
Save the file, and then press F9 to run the program, the initial picture of the program running as shown in Figure 2.
As the program runs, the toolbar automatically scrolls to show the rest of the toolbar as the mouse moves to or on the button, as shown in Figure 3.
Figure 2 Initial screen of program operation
Figure 3 Program Run results
If you set the AutoScroll property value of the Tpagescroller component to False, the toolbar will automatically scroll to show the rest of the toolbar when the program is running, only when you click or button.