ToolTipText like Office 2010 style

3 posts, 1 answers
  1. Jean-Marc Windholz
    Jean-Marc Windholz avatar
    42 posts
    Member since:
    Sep 2009

    Posted 04 Oct 2010 Link to this post

    Hi,
    I'm trying to set the tooltiptext of the radbutton with a title (first row in bold style) and a second part where write the description,
    for instance like the microsoft word 2010 style.
    First of all, I would like to know if is it possible to do, and if yes, how ?

    thank you so much
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 04 Oct 2010 Link to this post

    Hi, 

    You can reach it through the designer. In Telerik they are called ScreenTips. Or you can set them through code. 


    Here is a link to the Telerik RiboonBar section for adding Screentips
    http://www.telerik.com/help/winforms/ribbonbarfundamentalsusingscreentips.html

    Here is a static (shared) method that you can use to add a screentip to any rad item

    Public Shared Sub AddScreenTip(ByVal item As RadItem, ByVal headerText As String, ByVal bodyText As String)
     
        If item Is Nothing Then
            Throw New System.ArgumentNullException("item")
        End If
        If headerText Is Nothing Then
            Throw New System.ArgumentNullException("headerText")
        End If
        If bodyText Is Nothing Then
            Throw New System.ArgumentNullException("bodyText")
        End If
     
        If Not item.ScreenTip Is Nothing Then
            item.ScreenTip.Items.Clear()
        End If
        Dim Tip As New RadOffice2007ScreenTipElement()
        Tip.CaptionLabel.Text = headerText
        Tip.MainTextLabel.Text = bodyText
        item.ScreenTip = Tip
    End Sub

    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jean-Marc Windholz
    Jean-Marc Windholz avatar
    42 posts
    Member since:
    Sep 2009

    Posted 11 Oct 2010 Link to this post

    Hi,
    Thank you so much for the solution.
    Now It works fine :)

    Bye
Back to Top