Hi.
How could i adjust the width of buttontools on the toolbar according to text width?
Are you changing the Font size of individual tools? I don't believe the tools take into account their Font when measuring. I think this is ignored so all tools in the toolbar have the same height. If you do want to change the Font, change it on the toolbar's settings.
Anyone?
The problem still exists, when tools are added dynamically, they have default width (and width property is read-only in runtime)
What are you setting as their DisplayStyle on either their InstanceProps or SharedProps? By default on toolbars, only the image is displayed for ButtonTools. So by default, they should all have the same width. If this is the case, set the DisplayStyle to ImageAndText. If this is not the case, can you post a screen shot of what you application looks like at runtime? This will help me determine what the problem is.
I also create buttontools dynamically. Usually they have an image but if a button doesn't, I set its SharedProps:DisplayStyle to TextOnlyAlways instead of the default ImageAndText.