Shape.Move (Evento)
Se produce cuando se mueve la forma.
Espacio de nombres: Microsoft.VisualBasic.PowerPacks
Ensamblado: Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintaxis
'Declaración
<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 no admite eventos.
Comentarios
El evento de Move sólo aparece cuando cambia la ubicación de una forma con respecto a su contenedor, no cuando se mueve el contenedor.
Para obtener más información acerca de cómo controlar eventos, vea Utilizar eventos.
Ejemplos
En el ejemplo siguiente se muestra cómo responder al evento Move en un controlador de eventos.Este ejemplo requiere tener un control de OvalShape denominado OvalShape1 y un control de RectangleShape denominado RectangleShape1 en un formulario.
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();
}
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.
Vea también
Referencia
Microsoft.VisualBasic.PowerPacks (Espacio de nombres)
Otros recursos
Cómo: Dibujar líneas con el control LineShape (Visual Studio)
Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)
Introducción a los controles de líneas y formas (Visual Studio)