DragDrop.AddDragOverHandler(DependencyObject, DragEventHandler) 方法

定義

DragOver 事件處理常式加入指定的相依性物件中。Adds a DragOver event handler to a specified dependency object.

public:
 static void AddDragOverHandler(System::Windows::DependencyObject ^ element, System::Windows::DragEventHandler ^ handler);
public static void AddDragOverHandler (System.Windows.DependencyObject element, System.Windows.DragEventHandler handler);
static member AddDragOverHandler : System.Windows.DependencyObject * System.Windows.DragEventHandler -> unit
Public Shared Sub AddDragOverHandler (element As DependencyObject, handler As DragEventHandler)

參數

element
DependencyObject

要在其中加入事件處理常式的相依性物件 (UIElementContentElement)。The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler
DragEventHandler

參考要加入之處理常式方法的委派。A delegate that references the handler method to be added.

備註

當物件拖曳至專案的範圍上方時,就會發生 DragOver 事件。The DragOver event occurs when an object is dragged over the element's bounds.

這個方法會為 DragOver 事件的反升版本加入處理常式。This method adds a handler for the bubbling version of the DragOver event. 若要為此事件的通道版本新增處理常式,請參閱 AddPreviewDragOverHandlerTo add a handler for the tunneling version of this event, see AddPreviewDragOverHandler.

適用於

另請參閱