Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
Tooltip on Editorbuttons possible?
posted

Hello, 

is there a possibility to define a different tooltip on an each Editorbutton of an ultratexteditor?

regards

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    The ToolTip class works on the control level. So there's no way to apply a tooltip to part of a control. Typically, what you would do in a case like this is use the MouseMove event to change the tooltip on the control based on which button the mouse is over.

    The tricky part is determining which button the mouse is over. But this is easy once you know how. 


            private void ultraTextEditor1_MouseMove(object sender, MouseEventArgs e)
            {
                UltraTextEditor ultraTextEditor = (UltraTextEditor)sender;
                UIElement element = ultraTextEditor.UIElement.LastElementEntered;
                if (element != null)
                {
                    EditorButtonBase editorButton = element.GetContext(typeof(EditorButtonBase)) as EditorButtonBase;
                    if (editorButton != null)
                    {
                        Debug.WriteLine(editorButton.Key);
                        return;
                    }
                }

                Debug.WriteLine("No editor button found");
            }

     

Children