Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Weird tooltip behaviour when in popup
3 replies. Latest Post by Min-Hong Tang - MSFT on November 9, 2009.
(0)
tsheflin
Member
5 points
22 Posts
11-03-2009 11:44 AM |
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
Star
14606 points
2,730 Posts
11-04-2009 10:31 AM |
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>
11-04-2009 1:35 PM |
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...
Contributor
3619 points
412 Posts
11-09-2009 12:27 AM |
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