Calendar Cell ToolTip Behavior

4 posts, 1 answers
  1. Ben B
    Ben B avatar
    4 posts
    Member since:
    Apr 2012

    Posted 30 Apr 2012 Link to this post

    Dear Friends,

    Is there a way to manage the tooltip behavior of the calendar?

    When I use cell.ToolTipText ="Something" it look Ok, but,  with Long Text it's staying on one straight line!

    I wish to be able to Word Wrap the long text so I don't see it all across the screen!

    Thanks for any Infos!

    Ben
     

  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 01 May 2012 Link to this post

    Hello Ben, 

    You can control the size of the tooltip via the System.Windows.Forms.ToolTip and subscribing to the PopUp event
    E.g. 

    private ToolTip toolTip = null;
    private string tip = "";

    toolTip = this.radCalendar1.ElementTree.ComponentTreeHandler.Behavior.ToolTip;
    toolTip.Popup += new PopupEventHandler(toolTip_Popup);
    this.radCalendar1.ToolTipTextNeeded += new ToolTipTextNeededEventHandler(radCalendar1_ToolTipTextNeeded);

    void toolTip_Popup(object sender, PopupEventArgs e)
    {
       e.ToolTipSize = new Size(50, 300);
    }
     
    void radCalendar1_ToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
    {
        tip = "This is quite a long tip and will be broken down into several lines when the user hovers over and has a look at the tip";
        e.ToolTipText = tip;
    }

    and you can control other ToolTip elements. E.g. 
    toolTip = this.radCalendar1.ElementTree.ComponentTreeHandler.Behavior.ToolTip;
    toolTip.BackColor = System.Drawing.Color.LightBlue;
    toolTip.IsBalloon = true;

    Hope that helps
    Richard

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ben B
    Ben B avatar
    4 posts
    Member since:
    Apr 2012

    Posted 01 May 2012 Link to this post

    Hi Richard!

    Again, You Helped Me the First Shot!

    Thanks, I Appreciate It!

    Ben
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 01 May 2012 Link to this post

    Glad it helped, Ben! 
    Richard
Back to Top