ToolTip does not work on RadTextBox

9 posts, 0 answers
  1. Skywalker
    Skywalker avatar
    67 posts
    Member since:
    Sep 2007

    Posted 21 Nov 2007 Link to this post

    Hi,

    When I attach a ToolTip (System.Windows.Forms.ToolTip) to a RadTextBox, the ToolTip won't show up. When I attach the same ToolTip to the intrinsic TextBox (System.Windows.Forms.TextBox), the ToolTip works fine.

    Is this a bug, or am I missing something?

    Thanks,
  2. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 23 Nov 2007 Link to this post

    Hi Sipke,
    We have our own tooltip mechanism and it looks like it overrides the default one. You can use ours instead, it is just the same. To do so you can use the following code:

            private void Test_Load(object sender, EventArgs e)  
            {  
                this.radTextBox1.ButtonElement.ToolTipText = "test";  
            } 

    or

    this.radTextBox1.ToolTipTextNeeded += new Telerik.WinControls.ToolTipTextNeededEventHandler(this.radTextBox1_ToolTipTextNeeded);  
     
    private void radTextBox1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)  
    {  
        this.radTextBox1.ButtonElement.ToolTipText = "test";  


    All the best,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Skywalker
    Skywalker avatar
    67 posts
    Member since:
    Sep 2007

    Posted 23 Nov 2007 Link to this post

    Hi Dimitar,

    RadTextBox doesn't seem to have a ButtonElement property, but I did find the RootElement property, which in turn does have a ToolTipText property.
    However, when I set this property to a string, still no tooltip will show up.

    Your second suggestion also doesn't quite work, but I guess you meant to set the ToolTipText of the event argument ToolTipTextNeededEventArgs, which does work.

    Although handling the event works fine, I think it would be better if we could just set a ToolTipText property. The RootElement has this property, but somehow it doesn't display the Tooltip. Unless we handle the ToolTipTextNeeded event.

    In any case, thank you for the quick reply. It helped me figuring out how to make tooltips work :)

    Kind regards,

    Sipke
  5. Skywalker
    Skywalker avatar
    67 posts
    Member since:
    Sep 2007

    Posted 23 Nov 2007 Link to this post

    Hi Dimitar,

    When I handle the event ToolTipTextNeeded for a RadTextBox control, the argument 'sender' is of type RadTextBoxItem, instead of RadTextBox. How does that work? The RadTextBoxItem class has a AutoToolTip property, but I can't set this through the RadTextBox object instance. What is the relation between a RadTextBox and a RadTextBoxItem? Does RadTextBox 'own' a RadTextBoxItem object? If so, could it be possible to reference this object, so that I for example could set AutoToolTip to true?

    Thanks,
  6. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 26 Nov 2007 Link to this post

    Hi Sipke,
    First some comments regarding the architecture. We have a non windowed (without associated window handle) hierarchy of objects, and in the case of our RadTextBox it looks like:

    RadTextBox > RootElement > RadTextBoxElement > RadTextBoxItem.

    What you really need is to work with the lowest level, the  RadTextBoxItem which implements all key features.
    I apologize for the incorrect code snippets in my previous answer, let me clarify the proper way at the moment:

    ((RadTextBoxElement)this.radTextBox1.RootElement.Children[0]).TextBoxItem.AutoToolTip = true
     
    ((RadTextBoxElement)this.radTextBox1.RootElement.Children[0]).TextBoxItem.ToolTipText = "test";  




    Kind regards,
    Dimitar Kapitanov
    the Telerik team


    Instantly find answers to your questions at the new Telerik Support Center
  7. Skywalker
    Skywalker avatar
    67 posts
    Member since:
    Sep 2007

    Posted 26 Nov 2007 Link to this post

    Hi Dimitar,

    Ah I see, that makes many things more clear. :)
    Nice architecture. So I could assign a tooltip to each individual element of a control. I could attach a tooltip to the dropdownbutton of a combobox, and yet another tooltip to the TextBox element of the same combobox.

    Thank you very much for your feedback.

    Cheers,
    Sipke
  8. Michael
    Michael avatar
    6 posts
    Member since:
    Oct 2011

    Posted 03 Apr 2012 Link to this post

    Hi guys,
    is there any way to customise the look (IsBaloon,TooltipIcon, Colors) and behavior (Active, InitialDelay, ShowAlway) for the Telerik internal tooltip? I coudld also need a maximum length and text wrap for a tooltip.
    I was struggeling to get a language based tooltip text before and solved like described  here:
    http://www.telerik.com/community/forums/winforms/ribbonbar/iterate-trough-radribbonbar.aspx
    Therefore the solition should be without ToolTipTextNeeded event.

    If this is not possible, is there a way to get the standard winforms tooltip to work with RadTextBox etc..?

    many thanks,
    -Michael
    PS: I wished we had the same possibilities in winforms as with RadToolTip for asp.net/ajax.

  9. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 05 Apr 2012 Link to this post

    Hello Michael,

    Thank you for writing.

    No matter which tool tip you are using (the ToolTipText property of the ToolTipTextNeeded event), the standard .NET framework ToolTip  is used internally. Here is how to access its instance in order to customize it:
    radRibbonBar1.Behavior.ToolTip.ToolTipIcon = ToolTipIcon.Error;

    I hope that this information addresses your question. Let us know if you have any other questions.
     
    Kind regards,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  10. Michael
    Michael avatar
    6 posts
    Member since:
    Oct 2011

    Posted 12 Apr 2012 Link to this post

    Thank you. That brings me  a step forward.

    -Michael
Back to Top
UI for WinForms is Visual Studio 2017 Ready