ToolTip on RadForm TitleBar elements

7 posts, 2 answers
  1. Stefano
    Stefano avatar
    10 posts
    Member since:
    Feb 2012

    Posted 11 May 2018 Link to this post

    I need to show tooltips on the elements of a RadForm TitleBar, like in the attached image.

    things I've tried that didn't work:

    • setting the ToolTipText
    this.FormElement.TitleBar.SystemButtons.Children[0].ToolTipText = "this is a tooltip";

    • using the ToolTipTextNeeded  form event
    class TestTooltipForm : RadForm
    {
        public TestTooltipForm()
        {
            InitializeComponent();
     
            this.ToolTipTextNeeded += (sender, args) =>
            {
                args.ToolTipText = "a tooltip";
            };
        }
    }

    The only thing that seems to be working is instantiating a RadToolTip and showing it inside del ToolTipTextNeeded (ignoring the args parameter)

    The problem with this method is that the tooltip stays visible forever, so I need to hide it on some event like 'form_mouseHover' which is kind of convoluted.

    Is there a better way?


     

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2807 posts

    Posted 14 May 2018 Link to this post

    Hi Stefano,

    You need to set the AutoToolTip property as well:
    this.FormElement.TitleBar.SystemButtons.Children[1].ToolTipText = "Test1";
    this.FormElement.TitleBar.SystemButtons.Children[1].AutoToolTip  = true;
     
    this.FormElement.TitleBar.SystemButtons.Children[2].ToolTipText = "Test2";
    this.FormElement.TitleBar.SystemButtons.Children[2].AutoToolTip = true;
     
    this.FormElement.TitleBar.SystemButtons.Children[3].ToolTipText = "Test3";
    this.FormElement.TitleBar.SystemButtons.Children[3].AutoToolTip = true;

    In addition, the first child is the help button which is not visible by default. 

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Stefano
    Stefano avatar
    10 posts
    Member since:
    Feb 2012

    Posted 17 May 2018 in reply to Dimitar Link to this post

    setting AutoToolTip does not solve. No tooltip appears

    btw: here SystemButtons.Children has only 3 items and Children[0] is the minimize button, not the hidden 'help button'

     

     

     

  4. Dimitar
    Admin
    Dimitar avatar
    2807 posts

    Posted 18 May 2018 Link to this post

    Hello Stefano,

    This works as expected on my side. Which version of the suite are you using?

    I am looking forward to your reply.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Stefano
    Stefano avatar
    10 posts
    Member since:
    Feb 2012

    Posted 21 May 2018 in reply to Dimitar Link to this post

    You are right. I'm having the issue on a very old 2014.3.1202.40

    I've just tried on 2015.2.728.40 and it works. 

     

    Last question. In your example, how do I configure the tooltip aspect? Things like icon

  6. Answer
    Dimitar
    Admin
    Dimitar avatar
    2807 posts

    Posted 21 May 2018 Link to this post

    Hello Stefano,

    The tooltip can be accessed in the from's ToolTipTextNeeded event handler. Here is an example:
    private void RadForm1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
    {
        var item = sender as RadImageButtonElement;
        if (item != null && item == this.FormElement.TitleBar.SystemButtons.Children[1])
        {
            e.ToolTip.ToolTipIcon = ToolTipIcon.Warning;
            e.ToolTipText = "Test";
        }
    }

    If you want more complex layout in the tooltip to consider using Screen Tips | Telerik Presentation Framework.

    I hope this will be useful. 

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Stefano
    Stefano avatar
    10 posts
    Member since:
    Feb 2012

    Posted 21 May 2018 in reply to Dimitar Link to this post

    Works perfectly

    thanks

Back to Top