This is a migrated thread and some comments may be shown as answers.

ToolTip on RadForm TitleBar elements

6 Answers 135 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stefano
Top achievements
Rank 1
Stefano asked on 11 May 2018, 03:20 PM

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?


 

6 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 14 May 2018, 12:24 PM
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.
0
Stefano
Top achievements
Rank 1
answered on 17 May 2018, 04:26 PM

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'

 

 

 

0
Dimitar
Telerik team
answered on 18 May 2018, 10:18 AM
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.
0
Stefano
Top achievements
Rank 1
answered on 21 May 2018, 08:27 AM

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

0
Accepted
Dimitar
Telerik team
answered on 21 May 2018, 10:20 AM
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.
0
Stefano
Top achievements
Rank 1
answered on 21 May 2018, 11:16 AM

Works perfectly

thanks

Tags
General Discussions
Asked by
Stefano
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Stefano
Top achievements
Rank 1
Share this question
or