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
315
Using PointToScreen with ToolTip displays in wrong location
posted

Version 9.1

I'm using a ToolTip to display the full text of a trimmed UltraFormattedLinkLabel in a mock-up application I'm working on. I've used this code before on simpler forms, and it displays correctly. This form, which has a link label in a panel that's docked on the left via an UltraDockManager. In this case, as the attached picture shows, it's way off. Here's the code I'm using:

        private void link_MouseHover( object sender, EventArgs e ) {
            var lbl = (UltraFormattedLinkLabel) sender;
            var ui = lbl.UIElement.GetDescendant( typeof( FormattedLinkEmbeddableUIElement ) ) as FormattedLinkEmbeddableUIElement;
            if( ui == null || ui.IsDataFullyVisible )
                return;
            var tt = new ToolTip( lbl ) {
                                            DisplayStyle = ToolTipDisplayStyle.BalloonTip,
                                            ToolTipText = lbl.Value.ToString( )
                                        };
            var loc = this.PointToScreen( lbl.Location );
            tt.Show( new Point( loc.X, loc.Y + lbl.Height ) );
        }

Is there something I need to do differently here?