How to change Tooltip in Runtime?

3 posts, 1 answers
  1. Di
    Di avatar
    16 posts
    Member since:
    Jul 2013

    Posted 05 Jul 2013 Link to this post

    I have the RadMaskedNumericInput below:
    <telerik:RadMaskedNumericInput Name="txtC" Value="{x:Null}" IsClearButtonVisible="False"Mask="###" Placeholder=" " HorizontalContentAlignment="Right" HorizontalAlignment="Left" VerticalContentAlignment="Center" ToolTipService.ToolTip="cm" ValueChanged="txtC_ValueChanged" />

    and I need to know how to change its tooltip in runtime. I know it doesn't exists, but would be something like this:
    txtC.Tooltip = "cm (AAAAAAAA)";

    Di.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Jul 2013 Link to this post

    Hi Di,

    Silverlight offers a class called "ToolTipService" which can be used to display tooltips for Silverlight controls. This class can be attached to most of the UI elements in Silverlight to display tooltips. Please check the following C# code. Also check this article on Display Tooltip for Silverlight Controls.

    C#:
    ToolTipService.SetToolTip(MyButton, "This is new tooltip");

    Thanks,
    Princy.
  3. DevCraft banner
  4. Di
    Di avatar
    16 posts
    Member since:
    Jul 2013

    Posted 08 Jul 2013 Link to this post

    Thanks Princy, that's exactly what I needed.
    Di
Back to Top