Tooltip editable in treeview

2 posts, 0 answers
  1. Grace Pahuasi
    Grace Pahuasi avatar
    1 posts
    Member since:
    Dec 2009

    Posted 13 Jan 2010 Link to this post

    hi !
    1. exists any way to have a editable tooltip in treeview ?
            private void ToolTipNeeded(object sender, ToolTipTextNeededEventArgs e) 
                        TreeNodeUI tree = (TreeNodeUI)sender; 
                        int level = tree.AssociatedTreeNode.Level; 
                        if (level == 0) 
                            OnRaiseCustomEvent(new TooltipEventArgs(e)); 
            private void OnRaiseCustomEvent(TooltipEventArgs args) 
                EventHandler<TooltipEventArgs> handler = RaiseCustomEvent
                if (handler != null) 
                    //by the way  
                    args.ToolTipText = new RadTextBox(); 
                    args.ToolTipText.Text = "test";  
                    handler(this, args); 
            private void HandleToolTipEvent(object sender, TooltipEventArgs e) 
                e.ToolTipText.Text = "444";  
     public class TooltipEventArgs : ToolTipTextNeededEventArgs 
            private RadTextBox txtTextBox; 
            public TooltipEventArgs(ToolTipTextNeededEventArgs args) 
                txtTextBox = new RadTextBox(); 
                txtTextBox.BackColor = Color.Transparent; 
                txtTextBox.ForeColor = Color.Black; 
                txtTextBox.Enabled = true
                txtTextBox.Text = "test"
                args.ToolTipText = txtTextBox.Text ; 

    That code pretends show a textbox instead of string tooltip (but doesn't work), what I can do , to be able for view the textbox ?
    thanks  in advantage :]
  2. Martin Vasilev
    Martin Vasilev avatar
    1061 posts

    Posted 15 Jan 2010 Link to this post

    Hi Grace Pahuasi,

    Thank you for writing. There is no way to include an editable control in the standard ToolTip. That is because - by specification - the ToolTip serves only for displaying text. You have to keep in mind that the ToolStrip hides when you move the mouse outside the object that owns it. This makes editing impossible. Instead of adding a RadTextBox in the way that you have tried in your code, I recommend you create a custom form object with a RadTextBox inside it that you can show and hide according to your needs. 

    Do not hesitate to contact me again if you have any other questions.

    Best wishes,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
Back to Top