UIElement.LostMouseCapture UIElement.LostMouseCapture UIElement.LostMouseCapture UIElement.LostMouseCapture Event

定义

在此元素丢失鼠标捕获时发生。Occurs when this element loses mouse capture.

public:
 virtual event System::Windows::Input::MouseEventHandler ^ LostMouseCapture;
public event System.Windows.Input.MouseEventHandler LostMouseCapture;
member this.LostMouseCapture : System.Windows.Input.MouseEventHandler 
Public Custom Event LostMouseCapture As MouseEventHandler 

实现

注解

当某个元素捕获鼠标时, 它将接收鼠标输入, 即使指针在其边界之外也是如此。When an element captures the mouse, it receives mouse input even if the pointer is outside its bounds. 通常仅在拖放操作期间捕获鼠标。The mouse is typically captured only during drag-and-drop operations.

由于此事件使用冒泡路由, 失去捕获的元素可能是一个子元素, 而不是实际附加了事件处理程序的元素。Because this event uses bubbling routing, the element that loses capture might be a child element instead of the element where the event handler is actually attached. 检查事件Source数据中的, 以确定丢失捕获的实际元素。Check the Source in the event data to determine the actual element that lost capture.

此事件将为此类创建Mouse.LostMouseCapture附加事件的别名, 因此当继承LostMouseCapture为基元素时UIElement , 它是类成员列表的一部分。This event creates an alias for the Mouse.LostMouseCapture attached event for this class, so that LostMouseCapture is part of the class members list when UIElement is inherited as a base element. 附加到LostMouseCapture事件的事件处理程序附加到基础Mouse.LostMouseCapture附加事件, 并接收相同的事件数据实例。Event handlers that are attached to the LostMouseCapture event are attached to the underlying Mouse.LostMouseCapture attached event and receive the same event data instance.

路由事件信息Routed Event Information

标识符字段Identifier field LostMouseCaptureEvent
路由策略Routing strategy 冒泡Bubbling
委托Delegate MouseEventHandler
  • 未定义相应的隧道事件。There is no defined corresponding tunneling event.

  • OnLostMouseCapture写以在派生类中实现此事件的类处理。Override OnLostMouseCapture to implement class handling for this event in derived classes.

适用于