Skip to main content

Microsoft Silverlight

Answered Question Weird tooltip behaviour when in popupRSS Feed

(0)

tsheflin
tsheflin

Member

Member

5 points

22 Posts

Weird tooltip behaviour when in popup

I've noticed that if you create a Popup control with a Control in it, and set the ToolTip to something like "Test", it appears at very random locations when you hover the mouse over. Yet, if you display the exact same control with the same ToolTip not inside of a Popup, it works as expected (the ToolTip appears where the mouse is every time). Has anyone else noticed this behavior?

mchlsync
mchlsync

Star

Star

14606 points

2,730 Posts

Silverlight MVP

Re: Weird tooltip behaviour when in popup

I tested with this code. It's working fine. Can you share the code that is not working in your side? 

 <StackPanel >
            <Button Content="Click" Click="Button_Click" Height="30" Width="30" >
                <ToolTipService.ToolTip>
                    <ToolTip Content="This is tool tip for Button"></ToolTip>
                </ToolTipService.ToolTip>
            </Button>
            <Popup x:Name="pp" Height="80" Width="80" >
                <Button Content="Click Test"  Height="30" Width="30" >
                    <ToolTipService.ToolTip>
                        <ToolTip Content="This is tool tip for Button"></ToolTip>
                    </ToolTipService.ToolTip>
                </Button>
            </Popup>
        </StackPanel>

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Regards,
Michael Sync
Silverlight MVP

Blog : http://michaelsync.net


tsheflin
tsheflin

Member

Member

5 points

22 Posts

Re: Weird tooltip behaviour when in popup

That's because your popup is in the visual tree. I should have mentioned, it only occurs when the popup isn't in the visual tree.

If you remove your popup from xaml, and make your Button_Click event handler do this:

            Popup popup = new Popup();
popup.Width = 500;
popup.Height = 500;

Button button = new Button();
button.Width = 200;
button.Height = 200;
button.Content = "TOOLTIP TEST";
ToolTipService.SetToolTip(button, "Test popup tooltip");

popup.Child = button;

popup.IsOpen = true;

You'll see the problem. I made the popup/button huge because it makes the problem worse. The smaller the button/popup, the smaller the delta of the error is. In any case, you'll see as you move your mouse in and out to make the tooltip appear it's all over the place.

Min-Hong Tang - MSFT
Min-Hong...

Contributor

Contributor

3619 points

412 Posts

Answered Question

Re: Weird tooltip behaviour when in popup

Hi,

   Thanks so much for notifing us the phenomenon. I have reported this issue to the develop team. This is definitely not by desgin purpose.

   And they will work on it.

   We are very sorry , if this issue caused you any inconvenience.   Thanks again.

Best Regards

Min-Hong Tang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities