[英]Why TToolBar doesn't want to wrap?
I put a TToolBar
on my form and add some TSpeedButton
. 我在
TToolBar
上放了一个TToolBar
,并添加了一些TSpeedButton
。 I ensure myself that Wrapable
is set to true and run the application. 我确保将
Wrapable
设置为true并运行该应用程序。 But when I shrink the form the buttons don't wrap on new line. 但是当我缩小表单时,按钮不会换行。 What am I missing ?
我想念什么? I am using Delphi 2009.
我正在使用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. 您需要将
TToolBar.AutoSize
设置为True
,并在按钮组之间添加分隔符,以便可以将工具栏拆分为多个部分。
It's also better to use TToolButton
on the TToolBar
instead, as it's designed to work with them. 最好也改用
TToolButton
上的TToolBar
,因为它是为与它们一起使用而设计的。 Right-click the toolbar and choose New Button
or New Separator
. 右键单击工具栏,然后选择
New Button
或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. 将要显示的图像分配给
TImageList
,并将图像列表分配给TToolbar.Images
属性,然后为每个按钮设置ImageIndex
以显示列表中的图像。 (Another advantage is that you can also separate imagelists to the HotImages
and DisabledImages
properties as well.) (另一个优点是,您还可以将图像列表也分离到
HotImages
和DisabledImages
属性。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.