Evento Shape.Move

Si verifica quando la forma viene spostata.

Spazio dei nomi:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintassi

'Dichiarazione
<BrowsableAttribute(True)> _
Public Event Move As EventHandler
[BrowsableAttribute(true)]
public event EventHandler Move
[BrowsableAttribute(true)]
public:
 event EventHandler^ Move {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member Move : IEvent<EventHandler,
    EventArgs>
JScript non supporta gli eventi.

Note

Move l'evento si verifica solo quando cambia la posizione di una forma relativamente al relativo contenitore, non quando il contenitore viene spostato.

per ulteriori informazioni su come gestire gli eventi, vedere Utilizzo degli eventi.

Esempi

Nell'esempio seguente viene illustrato come rispondere a Move evento in un gestore eventi.Questo esempio presuppone che l'utente abbia OvalShape controllare OvalShape1 denominato e un oggetto RectangleShape controllare RectangleShape1 denominato in un form.

Private Sub OvalShape1_Move() Handles OvalShape1.Move
    Dim rect As New Rectangle
    ' Get the bounding rectangle for the rectangle shape.
    rect = RectangleShape1.DisplayRectangle
    ' Determine whether the bounding rectangles overlap.
    If rect.IntersectsWith(OvalShape1.DisplayRectangle) Then
        ' Bring the oval shape to the front.
        OvalShape1.BringToFront()
    End If
End Sub
private void ovalShape1_Move(object sender, System.EventArgs e)
{
    Rectangle rect = new Rectangle();
    // Get the bounding rectangle for the rectangle shape.
    rect = rectangleShape1.DisplayRectangle;
    // Determine whether the bounding rectangles overlap.
    if (rect.IntersectsWith(ovalShape1.DisplayRectangle))
    // Bring the oval shape to the front.
    {
        ovalShape1.BringToFront();
    }
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Shape Classe

Spazio dei nomi Microsoft.VisualBasic.PowerPacks

Altre risorse

Procedura: disegnare linee con il controllo LineShape (Visual Studio)

Procedura: disegnare forme con i controlli OvalShape e RectangleShape (Visual Studio)

Introduzione ai controlli Line e Shape (Visual Studio)