KB Article A384
Visible to All Users

How to get multi-line tooltips with a specific width

Description:
How to get multi-line tooltips with a specific width?

Answer:
By default, the maximum tooltip width is two thirds of the screen width. If you need shorter tooltips, you should handle the CalcSize event. Below is some sample code.

C#
private void toolTipController1_CalcSize(object sender, DevExpress.Utils.ToolTipControllerCalcSizeEventArgs e) { Size size = Size.Empty; Graphics g = CreateGraphics(); try { size = g.MeasureString(e.ToolTip, toolTipController1.Style.Font, (int)Screen.GetWorkingArea(e.SelectedControl).Width * 1 /3).ToSize(); } finally { g.Dispose(); } e.Size = size; }

See Also:
How to customize the ToolTip for a TreeList cell
Showing a hint for a grid cell even if its content is completely visible
How to programmatically display a tooltip for a control via the ToolTipController component
How to display a hint for an active editor within the XtraGrid
How to display hints only for particular cells

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.