RadToolTip BackColor is not working

2 posts, 0 answers
  1. Amal
    Amal avatar
    1 posts
    Member since:
    Jan 2017

    Posted 09 May 2017 Link to this post

    Hi Team,

     

    I have changed the backcolor of the tooltip with below code but it is not working,

     

    RadToolTip toolTip = new RadToolTip();
    toolTip.IsBalloon = true;
    toolTip.BackColor = Color.LightSkyBlue;
    toolTip.SetToolTip(this.button1, "Telerik test");
  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3323 posts

    Posted 11 May 2017 Link to this post

    Hello Amal, 

    Thank you for writing.  

    RadToolTip is a derivative of the MS ToolTip. The following StackOverflow thread demonstrates a sample approach how to customize the BackColor: http://stackoverflow.com/questions/12990757/change-winform-tooltip-backcolor

    Here is a sample code snippet: 
    public RadForm1()
    {
        InitializeComponent();
         
        this.radButton1.ShowItemToolTips = true;
        this.radButton1.ToolTipTextNeeded += radButton1_ToolTipTextNeeded;
    }
     
    private void radButton1_ToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
    {
        e.ToolTip.BackColor = Color.Yellow;
        e.ToolTip.ForeColor = Color.Red;
        e.ToolTipText = "Telerik button";
        e.ToolTip.OwnerDraw = true;
        e.ToolTip.Draw += ToolTip_Draw;
    }
     
    private void ToolTip_Draw(object sender, DrawToolTipEventArgs e)
    {
        ToolTip toolTip = sender as ToolTip;
     
        e.Graphics.FillRectangle(new SolidBrush(toolTip.BackColor), e.Bounds);
        e.DrawBorder();        
        e.DrawText(TextFormatFlags.Left);
    }

    I hope this information helps. Should you have further questions I would be glad to help.


    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top