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