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.

Get the Width of Bar Items

Thread ID:

Created:

Updated:

Platform:

Replies:

130665 May 24,2017 07:51 AM May 25,2017 03:28 AM Windows Forms 1
loading
Tags: XPToolbar
Swetaketu Majumder
Asked On May 24, 2017 07:51 AM

Hi,

Is it possible to get the widths of individual BarItems added to a XPToolbar?

Vijayalakshmi Roopkumar [Syncfusion]
Replied On May 25, 2017 03:28 AM

Hi Swetaketu

Thank you for contacting Syncfusion Support.

In XPToolBar, BarItem type of controls are used as its Child controls and its size will be calculated based on the defined font. At present, there is no direct option to achieve this requirement. We have prepared a workaround to retrieve BarItem width approximately. Please find the code example for the same:

Code Example: 
 
   //code used to measure the font width of XPToolBar 
(TextRenderer.MeasureText(this.barItem3.Text + "  ", this.xpToolBar1.Font).Width.ToString()); 
 
 
 

Screenshot: 

Regards,
Vijayalakshmi V.R. 


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.

;