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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get the Width of Bar Items

Thread ID:

Created:

Updated:

Platform:

Replies:

130665 May 24,2017 11:51 AM UTC May 25,2017 07:28 AM UTC WinForms 1
loading
Tags: XPToolbar
Swetaketu Majumder
Asked On May 24, 2017 11:51 AM UTC

Hi,

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

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

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.

Warning Icon 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.Close Icon

;