There are controls in my main application window, each of which opens a pop-up window that provides the user with more controls.
Other controls in the main application window have mousedoubleclick event handlers. My problem is that when the user double-clicks in the popup window, the controls behind the popup window receive mousedoubleclick events.
I tried to add the mousedoubleclick event handler to the popup parent and handle the event, but it still goes to the main application window.
private void ParentControl_MouseDoubleClick(object sender, MouseButtonEventArgs e) { e.Handled = true; }
I also tried calling Popup.CaptureMouse () in the MouseEnter event handler in a popup, but the method always fails (returns false).
void popup_MouseEnter(object sender, MouseEventArgs e) { e.Handled = true; Popup popup = sender as Popup; bool success = popup.CaptureMouse(); }
Are there other ways to prevent mouse events from triggering in the main application window when the popup is open?
Jim
source share