Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a few buttons in my wpf application, as well as a few Menu's with menu items. The problem is that whenever I hover over my buttons, the tooltip is being displayed at the upper left corner of my screen, and when I click on a menu, the menu items are also displayed on the upper left corner of the screen.

I am currently using Visual Studio 2010, and I am running Windows 7 64bit.

How can I resolve this?

If this would help, here is a sample of a control template used on a button:

XML
<ControlTemplate x:Key="CompileButton" TargetType="{x:Type Button}">
    		<Grid ToolTip="Run all test cases" Cursor="Hand">
    			<Ellipse x:Name="ell" Stroke="Black" StrokeThickness="0">
    				<Ellipse.Fill>
    					<ImageBrush ImageSource="Images/Compile.png"/>
    				</Ellipse.Fill>
    			</Ellipse>
    		</Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="Button.IsMouseOver" Value="True">
                    <Setter TargetName="ell" Property="Opacity" Value="0.7" />
                </Trigger>
            </ControlTemplate.Triggers>
    	</ControlTemplate>
Posted
Comments
Naz_Firdouse 30-Jul-13 6:19am    
have you set the tooltip for button like this
http://wpftutorial.net/ToolTip.html[^]
Andrew797 30-Jul-13 6:27am    
Even setting it like that displays the tooltip at the top, on the left hand side, and not where the mouse cursor is.

1 solution

Think what you need to do is use the ToolTipService.PlacementRectangle http://msdn.microsoft.com/en-us/library/system.windows.controls.tooltipservice.placementrectangle.aspx[^]
 
Share this answer
 
Comments
Andrew797 31-Jul-13 2:49am    
This did not work either.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900