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.
Unfortunately, activation email could not send to your email. Please try again.

How to increase the size of bar items in main menu?

Thread ID:

Created:

Updated:

Platform:

Replies:

118336 Feb 26,2015 06:17 AM Mar 3,2015 11:45 AM Windows Forms 3
loading
Tags: MainFrameBarManager
Sergei Leschinksy
Asked On February 26, 2015 06:17 AM

Is it possible to adjust (increase) the size of menu items when I use icons larger than 16px? I can set larger icons but the height of items doesn't change. To be precise I mean BarItems which are added to ParentBarItem, which in turn is added to XPMenus.Bar created with MainFrameBarManager. Thanks. 

Vinothini [Syncfusion]
Replied On March 2, 2015 01:28 AM

Hi Sergei,

Thank you for using Syncfusion products.

At present there is no option to customize the image size in ChildBarItem and ChildBarItem size will be defined based on its font size. So we suggest you to make use of CustomFontText property in BarItem, to customize its size. Please have the code snippet below which demonstrate the same.

Code Snippet [C#]:

// Font Size

this.barItem1.CustomTextFont = new System.Drawing.Font("Microsoft Sans Serif", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

//Image size

this.barItem1.ImageSize = new System.Drawing.Size(50, 40);

We have also prepared sample and image for your reference and it can be downloaded from the following location.

Image Location: http://www.syncfusion.com/uploads/user/directTrac/118336/baritem-1282466376.zip

Sample Location : http://www.syncfusion.com/uploads/user/directTrac/118336/BarItem974254172.zip​ 

Note : The default BarItem image size can be customized using ImageSize property.

Please let us know if it helps,

Regards,

Vinothini.R



Sergei Leschinksy
Replied On March 2, 2015 04:04 AM

Thanks for the answer. Custom font increases the size of items indeed. Although I'm not sure that it looks particularly good. Most likely I'd choose either to limit myself to small icons or use regular MenuStrip embedded in detached CommandBar instead. Would be great, guys, if you add this functionality, i.e. calculate the size of menu items depending on both font and icon size + some customizable padding. I guess having 24 px icons in menus without scaling the font isn't too unreasonable demand.

Best regards,
Sergei

Ashwini Jaya Preetha Durai Samy [Syncfusion]
Replied On March 3, 2015 11:45 AM

Hi Sergei,

 

Thank you for your update.

 

As per the implementation of child BarItem, its bounds calculation will be done based on its font size. Hence we have suggested you the same. We request you to use this approach, to achieve this reported behavior.

 

Please let us know if you need any further assistance,

 

Regards,

Ashwini


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;