Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8556209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:17:41+00:00 2026-06-11T15:17:41+00:00

I have a label whose mouseover event opens up a popup. I am trying

  • 0

I have a label whose mouseover event opens up a popup.

I am trying to handle the mouseleave event on the popup window and close the popup down.

The problem I’m having is that the mouseleave event is not getting fired until I click anywhere outside the popup window.

Could someone advise me as to what Im doing wrong?

Heres the code.

XAML:

<Popup Name="myPopup" IsOpen="False" PlacementTarget="{Binding ElementName=myButton}" StaysOpen="False" MouseLeave="myPopup_MouseLeave">

    <DataGrid MinHeight="400" MinWidth="300" Name="dtgPopup" AutoGenerateColumns="False" ItemsSource="{Binding}" SelectionChanged="dtgPopup_SelectionChanged"  IsReadOnly="True" CanUserAddRows="False">

    </DataGrid>

</Popup>

<Label Name="recentPanels" Content="Recent Panels" MouseEnter="recentPanels_MouseEnter"/>

Event Handlers:

private void recentPanels_MouseEnter(object sender, MouseEventArgs e)
        {
            myPopup.IsOpen = true;
        }

        private void myPopup_MouseLeave(object sender, MouseEventArgs e)
        {
            myPopup.IsOpen = false;
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:17:42+00:00Added an answer on June 11, 2026 at 3:17 pm

    From my experience it seems to need the mouse click to realize that the mouse pointer has actually left the form or popup. A work around that is simple to implement is as follows, instead of using the MouseLeave event use the OnMouseLeave.

    protected virtual void OnMouseLeave(MouseEventArgs e)
    {
        myPopup.IsOpen = false;
    }
    

    Some more information: http://msdn.microsoft.com/en-us/library/system.windows.controls.control.onmouseleave(v=vs.95).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Label, whose content is displayed by a while loop. when i
I have a label that overlays on an MKMapView . The only problem is,
I have a template field in a gridview with a label whose text I
I have an element whose html is like : <div class=gwt-Label textNoStyle textNoWrap titlePanelGrayDiagonal-Text>Announcements</div>
I have an NSTextField label whose value is bound to controller.status When I call
I have a telerik window with multiple divs inside it whose visibility is set
Hi.. I have a label whose background is gradient by default(IE ). label{ width:100px;
I have a very simple usercontrol, basically a textbox and a label, whose purpose
I have a window whose content changes. Sometimes the content is larger than the
On my page I have a drop down whose values are populated based on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.