Restrict tooltiptext displaying area

2 posts, 0 answers
  1. Alvin
    Alvin avatar
    6 posts
    Member since:
    Nov 2011

    Posted 07 Dec 2011 Link to this post


    I have created ListVisualElement for storing a very long string, and also assign the string to the element's ToolTipText property.

    When this visual element displayed in the RadListView and hover my cursor over it, the tooltip is displayed. Because the string is very long, the tooltip area will across the whole screen and some characters at the beginning of the string is cut.

    Is there any way to specify the width of tooltip and the tooltip's displaying location?

  2. Ivan Todorov
    Ivan Todorov avatar
    688 posts

    Posted 12 Dec 2011 Link to this post

    Hello Alvin,

    Thank you for your question.

    There is no way to specify the width or height of the tooltip. However, you can modify its displaying location and also limit the length of its text on the ToolTipTextNeeded event as it is shown in the following code snippet:
    void radListView1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
        //Specifies the offset according to the current position of the mouse cursor
        e.Offset = new Size(e.Offset.Width + 20, e.Offset.Height + 20);
        //Specifies the text that will be displayed in the tooltip
        e.ToolTipText = e.ToolTipText.Substring(0, Math.Min(75,e.ToolTipText.Length));

    I hope you find this helpful. If you have any additional questions, do not hesitate to write back.

    Ivan Todorov
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  3. DevCraft banner
Back to Top