简体   繁体   中英

Why TToolBar doesn't want to wrap?

I put a TToolBar on my form and add some TSpeedButton . I ensure myself that Wrapable is set to true and run the application. But when I shrink the form the buttons don't wrap on new line. What am I missing ? I am using Delphi 2009.

You need to set the TToolBar.AutoSize to True , and add separators between groups of buttons so there's a place for it to split the toolbar into sections.

It's also better to use TToolButton on the TToolBar instead, as it's designed to work with them. Right-click the toolbar and choose New Button or New Separator . Assign the images you want to display to a TImageList , and assign the imagelist to the TToolbar.Images property, then set the ImageIndex for each button to display an image from the list. (Another advantage is that you can also separate imagelists to the HotImages and DisabledImages properties as well.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM