Window.DragMove メソッド

定義

ウィンドウのクライアント領域の表示部分でマウスの左ボタンを押したままにすることにより、ウィンドウをドラッグできるようにします。

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 ()
属性

例外

マウスの左ボタンが押されていません。

をオーバーライド OnMouseLeftButtonDown して を呼び出 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

注釈

が呼び出されると DragMove 、マウスの左ボタンがダウンしている必要があります。 マウスの左ボタンが押されたときに検出する 1 つの方法は、イベントを MouseLeftButtonDown 処理することです。

が呼び出されると DragMove 、ウィンドウのクライアント領域の公開領域の上にマウスの左ボタンを押す必要があります。

注意

ウィンドウがブラウザーでホストされている場合、このメソッドを呼び出すことはできません。

適用対象

こちらもご覧ください