We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Resizing xp menu toolbar items within code.

Is there a way to resize a toolbar item in code? I am adding a image in code and the otem doesn''t resize to fit the image so I would like to manually resize it. Thanks.

4 Replies

AD Administrator Syncfusion Team March 1, 2004 04:44 PM UTC

Hi Ronda, Please set the BarItem''s PaintStyle property to PaintStyle.ImageAndText enumeration value. This will automatically resize the BarItem (to display both text and image) when a image is being displayed. Please try this and let me know how it goes. We appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


RO Ronda March 2, 2004 12:07 PM UTC

I did try this. It''s still not the right size. I am adding images that are 24X24. If I use a image list the resizing occurs but I cannot use them.


RO Ronda March 2, 2004 04:18 PM UTC

Can I manually change the size of the toolbar? When is the size set? It seems to happen before the on paint event is fired. Possibly in the init?


AD Administrator Syncfusion Team March 2, 2004 07:27 PM UTC

Hi Ronda, 1. The BarItem does not expose any APIs to set its bounds. The only way to auto resize the BarItem (to display both text and image) is by BarItem''s PaintStyle property. 2. Also, the only way to set images to the BarItem is through an ImageList and specifying the ImageIndex value. 3. If you are not adding the images through a ImageList, how are you doing it ? I have attached a sample here which shows how this can be done. Please refer to the sample and let me know if this meets your requirements. If not, kindly modify it to show the problem that you are facing. We appreciate your cooperation. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon