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

RadButton and Tooltips

6 Answers 2074 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Brummi
Top achievements
Rank 1
Brummi asked on 25 Jun 2007, 08:06 AM
Greetings Telerik,

I just tried to add a tooltip-text to a RadButton (image only), but i don't see any property for this. I assumed there's this possibility since there is a property named "ShowItemToolTips" (which is set to yes).

Is this a bug or doesn't it exist?

Many thanks,
Daniel

6 Answers, 1 is accepted

Sort by
0
Dimitar Kapitanov
Telerik team
answered on 25 Jun 2007, 09:01 AM
Hi Brummi,
In RadButton you have a property named  RadButtonElement ButtonElement. Through this property you access the internal element that is used to render the button, and it is a descendant of RadItem. Every RadItem has the property ToolTipText, so basically you can set it like:

MyButton.ButtonElement.ToolTipText = "MyButton"

Greetings,
Dimitar Kapitanov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Sathish
Top achievements
Rank 1
Iron
Iron
Iron
commented on 23 Oct 2024, 08:18 AM

Hi Mohammed.

I am able to see the RadButton ToolTipText on hover.

But I have another requirement here.

I want to change the ToolTipText on click and hide older ToolTipText immediately after clicking on button.

Example:

  • On Hover = "Copy".
  • On Click = "Copied".

Thanks in advance.

Nadya | Tech Support Engineer
Telerik team
commented on 23 Oct 2024, 12:33 PM

Hello, Sathish,

To achieve this requirement, you need to handle mouse events of RadButton and change the ToolTipText there. For example, you can set the ToolTipText to "Copy" initially, then handle the RadButton.Clcik event and change the tooltip text there to "Copied!". Thus, when you click on the button, the tooltip text will get updated. 

I hope this information helps. If you have other questions do not hesitate to ask. 

Sathish
Top achievements
Rank 1
Iron
Iron
Iron
commented on 23 Oct 2024, 12:38 PM

I already tried it, but the problem here is. The older text("Copy") is not hiding immediately. Showing both "Copy" and "Copied!" on the screen.

 

I want the older text to be invisible immediately after clicking on button and show only new text "Copied!" on the screen.

Nadya | Tech Support Engineer
Telerik team
commented on 24 Oct 2024, 01:15 PM

Hello, Sathish,

What comes to my mind is to consider using RadTaskDialog for this case, if it is suitable for you. RadTaskDialog is a themable alternative of the windows dialog box. The dialog box is a window that allows users to perform a command, ask the users a question, provide users with information, so on. You can create a simple task dialog with relevant information and show it when necessary. 

Can you give it a try and see whether it will be more suitable for you instead of using tooltips.

Sathish
Top achievements
Rank 1
Iron
Iron
Iron
commented on 24 Oct 2024, 01:20 PM

 

Hi Nadya.

This is not my requirement.

Sathish
Top achievements
Rank 1
Iron
Iron
Iron
commented on 25 Oct 2024, 06:26 AM

Hi Nadya.

Please see the GIF. It may help you to understand what I am looking for.

Here OnHover there is different ToolTip. But OnClick it is replacing older to new ToolTip. This is my requirement.

 

Thanks in advance.

Todor
Telerik team
commented on 25 Oct 2024, 09:04 AM

Hello, Sathish,

According to the GIF you provided you want to change dynamically the text of the shown tool tip when the user clicks the button.
My recommendation is to use ScreenTip, which has similar behavior to ToolTip, but is customizable, themable, and allows runtime changes to the displayed text. Here is a code snippet that illustrates how to use the screen tip and modify the text on mouse click:

private RadOffice2007ScreenTipElement screenTipElement;

public RadForm1()
{
    InitializeComponent();

    this.screenTipElement = new RadOffice2007ScreenTipElement();
    this.screenTipElement.CaptionLabel.Text = string.Empty;
    this.screenTipElement.MainTextLabel.Text = "Copy title to Clipboard";
    this.radButton6.ButtonElement.ScreenTip = this.screenTipElement;
}

private void RadButton1_Click(object sender, EventArgs e)
{
    if (this.screenTipElement != null)
    {
        this.screenTipElement.MainTextLabel.Text = "Copied to Clipboard";
    }
}
And later when you later need to update the screen tip text set the this.screenTipElement.MainTextLabel.Text = "New text".


I hope this helps. If you have any further questions, do not hesitate to contact me. 

Sathish
Top achievements
Rank 1
Iron
Iron
Iron
commented on 28 Oct 2024, 11:30 AM

However, I am not using this. Because this is not flexible. 

  • The ToolTip width is fixed. (After changing the ToolTip on click all the texts are not visible, due to its fixed width size).
  • ToolTip does not show quickly, taking time to show ToopTip text on Hover.

Thank you.

Nadya | Tech Support Engineer
Telerik team
commented on 30 Oct 2024, 09:24 AM

Hello, Sathish,

If I understand correctly you prefer using Tooltips over screen tips. However, tooltips always take time to show when hover. This is the purpose of using tooltips when the user rests the pointer on the control: ToolTip Class (System.Windows.Forms) | Microsoft Learn

Note, RadToolTip is a derivative of MS Tooltip, hence it inherits all the advantages and disatvatages of the standard control. I understand that the too tip is not working exactly as you expect, this is why me and Todor suggested another possible solution which are very close to what you want to achieve. However, you used to reject them and at this moment I can not suggest other working solution. Feel free to make your own research in the general programming forums about how this task can be accomplished either using RadToolTip or MS Tooltip. 

Please let me know if I can assist you further.

Sathish
Top achievements
Rank 1
Iron
Iron
Iron
commented on 30 Oct 2024, 09:40 AM

Hello Nadya.

I know, ToolTip take time to show when hover. 

 

But I compare the time with RadOffice2007ScreenTipElement(). RadOffice2007ScreenTipElement time is too much. 

I think, time delay of both,

  • RadToolTip = 1 sec.
  • RadOffice2007ScreenTipElement() = 2 sec.

And also, RadOffice2007ScreenTipElement() ToolTip width is not increasing after change, it is fixed size. We should not increase characters more than the first time.

Nadya | Tech Support Engineer
Telerik team
commented on 01 Nov 2024, 09:23 AM

Hello, Sathish,

RadToolTip and RadOffice2007ScreenTipElement have an initial delay before showing. For RadToolTip it is 500, for RadOffice2007ScreenTipElement it is 900. If you want you can set the delay for RadOffice2007ScreenTipElement to 500 the same as RadToolTip. This can be done in the button's ScreenTipNeeded event, through the ScreenTipNeededEventArgs you should be able to set e. Delay property to desired value. 

As to the size of RadOffice2007ScreenTipElement, you can update it when performing click on the button. Thus, you can change boththe text and the size of the screen tip. Note, it is up to you to calculate the exact size that needs to be displayed. Please refer to the following code snippet:

private void RadButton1_ScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
{
    e.Delay = 500;
}

private void radButton1_Click(object sender, EventArgs e)
{
    if (this.screenTipElement != null && screenTipElement.ElementTree != null)
    {
        this.screenTipElement.MainTextLabel.Text = "Copied";
        (screenTipElement.ElementTree.Control as RadScreenTip).Width = 50;
        screenTipElement.ElementTree.Control.FindForm().Width = 50;
    }
}

I believe this will help you achieve the desired behavior that you need. The achieved result is demonstrated in the gif file.

0
Brummi
Top achievements
Rank 1
answered on 25 Jun 2007, 09:15 AM
Hi Dimitar,

Aah, that's well "hidden" :) Thank you very mutch for your assistance!

Regards,
Daniel
0
Mohammed
Top achievements
Rank 2
answered on 26 Feb 2013, 01:07 PM
Hi,
I use Q3 2012 and i set auto tool tip = true and toot tip text and show item tool tip but still not working.
Regards,
mohammed
0
Stefan
Telerik team
answered on 28 Feb 2013, 09:52 AM
Hi Mohammed,

Thank you for writing.

The behavior is still the same - just set the ToolTipText property of the ButtonElement, and when you hover the button, the tool tip will be shown:
radButton1.ButtonElement.ToolTipText = "hello";

I hope this helps.
 

Kind regards,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Join us for a FREE webinar to see all the new stuff in action.

Interested, but can’t attend? Register anyway and we’ll send you the recording.
Sathish
Top achievements
Rank 1
Iron
Iron
Iron
commented on 23 Oct 2024, 08:18 AM

Hi Mohammed.

I am able to see the RadButton ToolTipText on hover.

But I have another requirement here.

I want to change the ToolTipText on click and hide older ToolTipText immediately after clicking on button.

Example:

  • On Hover = "Copy".
  • On Click = "Copied".

Thanks in advance.

0
Rudyard
Top achievements
Rank 1
answered on 13 Jan 2017, 12:46 AM
Controls are awesome, The sources are not so much, every VS version tried comes up with errors, I should tell Erik, seriously the name where does it come from, and why is the source buggy
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Jan 2017, 07:56 AM
Hello Rudyard,

Thank you for writing.  

Could you please specify in details the exact problem that you are facing? What steps should I perform in order to reproduce the problem? Thus, we would be able to investigate the precise case and assist you further. Thank you.

I am looking forward to your reply.

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.
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Brummi
Top achievements
Rank 1
Answers by
Dimitar Kapitanov
Telerik team
Brummi
Top achievements
Rank 1
Mohammed
Top achievements
Rank 2
Stefan
Telerik team
Rudyard
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or