We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MouseEnter event for annotation isn't working

Thread ID:





141050 Nov 20,2018 02:30 PM UTC Nov 21,2018 11:30 AM UTC WPF 3
Tags: SfChart
Asked On November 20, 2018 02:31 PM UTC

Hi, I can't get the MouseEnter event to fire for an EllipseAnnotation.

Attached is a sample. Run the sample and click the red circle. A popup is displayed with two hyperlinks. What I want is that the popup is displayed when the mouse is hovering over the annotation (via the MouseEnter event) instead. How can this be achieved?

Thank you.

Attachment: sfChartCrossHair_b54617e3.rar

Muneesh Kumar G [Syncfusion]
Replied On November 21, 2018 09:27 AM UTC

Hi Tom, 
Greetings from Syncfusion, we have analyzed your query and we would like to inform you that we have drawn annotation rendering element using separate shape. So, we have raised below mouse events manually for annotation shape in our source.  
1.       MouseRightButtonDown 
2.       MouseRightButtonUp 
3.       MouseUp 
4.       MouseDown 
5.       MouseMove 
6.       MouseLeftButtonDown 
7.       MouseLeftButtonUp 
8.       MouseLeave 
Except these events you have to raise other events manually as per the below code snippet.  
Code snippet 
Protected Overrides Function ArrangeOverride(finalSize As Size) As Size 
        AddHandler AnnotationElement.MouseEnter, AddressOf MouseEnter 
        Return MyBase.ArrangeOverride(finalSize) 
    End Function 
    Private Sub MouseEnter(sender As Object, e As MouseEventArgs) 
        'SET POSITION 
        Dim pt As Point = e.GetPosition(CType(MainWindow.gMain, UIElement)) 
        MainWindow.AnnotationPopup.Placement = Primitives.PlacementMode.RelativePoint 
        MainWindow.AnnotationPopup.IsOpen = True 
    End Sub 
    Private Sub CustomEllipseAnnotation_MouseLeave(sender As Object, e As MouseEventArgs) Handles Me.MouseLeave 
        MainWindow.AnnotationPopup.IsOpen = False 
    End Sub 
We have modified your sample based on this, now the sample works fine as per your expect. Please find the sample from the following location.  
Hope it helps.  
Muneesh Kumar G.  

Replied On November 21, 2018 10:30 AM UTC

Brilliant, Muneesh, thank you so much. Now the MouseEnter event for the annotation works. Just a minor detail, I had to move the MouseLeave handling code over to the MouseLeave event of the Popup instead to solve the flickering issue. Now, there are no problems.

Muneesh Kumar G [Syncfusion]
Replied On November 21, 2018 11:30 AM UTC

Hi Tom,  
Thanks for the update. 
We are glad to know that the given solution works. Please let us know if you need any further assistance. 
Muneesh Kumar G.  


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon