Window.DragMove Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Allows a window to be dragged by a mouse with its left button down over an exposed area of the window's client area.
public:
void DragMove();
[System.Security.SecurityCritical]
public void DragMove ();
public void DragMove ();
[<System.Security.SecurityCritical>]
member this.DragMove : unit -> unit
member this.DragMove : unit -> unit
Public Sub DragMove ()
- Attributes
Exceptions
The left mouse button is not down.
Examples
The following example shows how to override OnMouseLeftButtonDown to call DragMove.
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
// Begin dragging the window
this.DragMove();
}
Protected Overrides Sub OnMouseLeftButtonDown(ByVal e As MouseButtonEventArgs)
MyBase.OnMouseLeftButtonDown(e)
' Begin dragging the window
Me.DragMove()
End Sub
Remarks
The left mouse button must be down when DragMove is called. One way to detect when the left mouse button is pressed is to handle the MouseLeftButtonDown event.
When DragMove is called, the left mouse button must be depressed over an exposed area of the window's client area.
Note
This method cannot be called when a window is hosted in a browser.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om