Winforms Screen Tip on RadMenuButtonItem

2 posts, 0 answers
  1. Tim
    Tim avatar
    1 posts
    Member since:
    Feb 2018

    Posted 08 May Link to this post

    I see that there is a ScreenTip associated with the button but it's not functioning for me.  Snippet of code:

     

    var coolScreenTip = new RadOffice2007ScreenTipElement();
    coolScreenTip.CaptionLabel.Text = wrkItem.GroupTitle;
    coolScreenTip.MainTextLabel.Text = string.Format("{0}\n{1}",wrkItem.Title, wrkItem.Description);
    coolScreenTip.FooterTextLabel.Text = "Test Footer";
    coolScreenTip.FooterVisible = true;
     
    var QuickMenuItem = new RadMenuButtonItem(strTitle)
    {
    //    ToolTipText = wrkItem.Description,
        KeyTip = "quick",
        Tag = wrkItem.OriginId,
        ScreenTip = coolScreenTip
    };
    QuickMenuItem.Click += quickMenu_Click;
    radMenuItemQuick.Items.Add(QuickMenuItem);

     

    Hovering over any button does not show the screen tip.  This code seems to work fine for inside of a grid, but there is a "needscreentip" event.

    Any help would be appreciated!

     

  2. Dimitar
    Admin
    Dimitar avatar
    2743 posts

    Posted 09 May Link to this post

    Hi Tim,

    One way to solve this is to set the screen tip of the button element:
    QuickMenuItem.ButtonElement.ScreenTip = coolScreenTip;

    The other is to use the ScreenTipNeeded event of the RadMenu (all RadControls have this event and it will be fired for the element under the mouse):
    private void RadMenu1_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
    {
        if (e.Item is RadButtonElement)
        {
            var button = e.Item as RadButtonElement;
            if (button.Text == "Button")
            {
                button.ScreenTip = coolScreenTip;
            }
        }
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top