Compartir a través de


SimpleShape.BackgroundImageLayoutChanged (Evento)

Tiene lugar cuando cambia la propiedad BackgroundImageLayout de una 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 BackgroundImageLayoutChanged As EventHandler
[BrowsableAttribute(true)]
public event EventHandler BackgroundImageLayoutChanged
[BrowsableAttribute(true)]
public:
 event EventHandler^ BackgroundImageLayoutChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member BackgroundImageLayoutChanged : IEvent<EventHandler,
    EventArgs>
JScript no admite eventos.

Comentarios

Este evento se produce si el BackgroundImageLayout propiedad se modifica mediante programación o por la interacción del usuario.

Para obtener más información acerca de cómo controlar eventos, vea Controlar y provocar eventos.

Ejemplos

En el ejemplo siguiente se muestra cómo responder a la BackgroundImageLayoutChanged evento en un controlador de eventos. Este ejemplo requiere que haya un RectangleShape control denominado RectangleShape1 en un formulario.

Private Sub RectangleShape1_BackgroundImageLayoutChanged(
  ) Handles RectangleShape1.BackgroundImageLayoutChanged

    ' If the image is centered, check its size. 
    If RectangleShape1.BackgroundImageLayout = ImageLayout.Center Then 
        Dim imageSize As SizeF
        imageSize = RectangleShape1.BackgroundImage.PhysicalDimension
        ' If the image is smaller than the shape, change the BackColor. 
        If imageSize.Height < RectangleShape1.ClientSize.Height OrElse
          imageSize.Width < RectangleShape1.ClientSize.Width Then
            RectangleShape1.BackColor = Color.Black
        End If 
    End If 
End Sub
private void rectangleShape1_BackgroundImageLayoutChanged(object sender, 
    System.EventArgs e)
{
    // If the image is centered, check its size. 
    if (rectangleShape1.BackgroundImageLayout == ImageLayout.Center)
    {
        SizeF imageSize;
        imageSize = rectangleShape1.BackgroundImage.PhysicalDimension;
        // If the image is smaller than the shape, change the BackColor. 
        if (imageSize.Height < rectangleShape1.ClientSize.Height || 
            imageSize.Width < rectangleShape1.ClientSize.Width)
        {
            rectangleShape1.BackColor = Color.Black;
        }
    }
}

Seguridad de .NET Framework

Vea también

Referencia

SimpleShape Clase

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

Introducción a los controles de líneas y formas (Visual Studio)

Cómo: Dibujar líneas con el control LineShape (Visual Studio)

Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)