Share via


InkPicture.SelectionResizing (Evento)

Actualización: noviembre 2007

Se produce cuando el tamaño de la selección actual está a punto de cambiar, por ejemplo por alteraciones de la interfaz de usuario, procedimientos de cortar y pegar o la propiedad Selection.

Espacio de nombres:  Microsoft.Ink
Ensamblado:  Microsoft.Ink (en Microsoft.Ink.dll)

Sintaxis

'Declaración
Public Event SelectionResizing As InkOverlaySelectionResizingEventHandler
'Uso
Dim instance As InkPicture
Dim handler As InkOverlaySelectionResizingEventHandler

AddHandler instance.SelectionResizing, handler
public event InkOverlaySelectionResizingEventHandler SelectionResizing
public:
 event InkOverlaySelectionResizingEventHandler^ SelectionResizing {
    void add (InkOverlaySelectionResizingEventHandler^ value);
    void remove (InkOverlaySelectionResizingEventHandler^ value);
}
/** @event */
public void add_SelectionResizing (InkOverlaySelectionResizingEventHandler value)
/** @event */
public void remove_SelectionResizing (InkOverlaySelectionResizingEventHandler value)
JScript no admite eventos.

Comentarios

El controlador de eventos recibe un argumento de tipo InkOverlaySelectionResizingEventArgs que contiene datos sobre este evento.

Cuando se crea un delegado de InkOverlaySelectionResizingEventHandler, se identifica el método que controla el evento. Para asociarlo al controlador de eventos, se debe agregar al evento una instancia del delegado. Siempre que se produce el evento, se llama a su controlador, a menos que se quite el delegado. Para mejorar el rendimiento, el interés del evento predeterminado está desactivado, pero se activa automáticamente si se agrega un controlador de eventos.

Ejemplos

En este ejemplo, un controlador de eventos SelectionResizing examina una selección antes de cambiar su tamaño. Si se va a cambiar el tamaño de la selección y una parte va a quedar fuera de los límites de la ventana, el controlador de eventos establece la selección en rojo cambiando la propiedad Color de cada objeto Stroke seleccionado.

Private Sub mInkPicture_SelectionResizing(ByVal sender As Object, ByVal e As InkOverlaySelectionResizingEventArgs)
    If e.NewPixelRect.Left < 0 Or e.NewPixelRect.Top < 0 Or _
       e.NewPixelRect.Right > mInkPicture.ClientRectangle.Width Or _
       e.NewPixelRect.Bottom > mInkPicture.ClientRectangle.Height Then

        For Each stroke As Stroke In mInkPicture.Selection
            ' change the stroke color
            stroke.DrawingAttributes.Color = Color.Red
        Next

    End If
End Sub
private void mInkPicture_SelectionResizing(object sender, InkOverlaySelectionResizingEventArgs e)
{
    if (e.NewPixelRect.Left < 0 || e.NewPixelRect.Top < 0 ||
        e.NewPixelRect.Right > mInkPicture.ClientRectangle.Width ||
        e.NewPixelRect.Bottom > mInkPicture.ClientRectangle.Height)
    {
        foreach (Stroke stroke in mInkObject.Selection)
        {
            // change the stroke color
            stroke.DrawingAttributes.Color = Color.Red;
        }
    }
}

Plataformas

Windows Vista

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Framework

Compatible con: 3.0

Vea también

Referencia

InkPicture (Clase)

InkPicture (Miembros)

Microsoft.Ink (Espacio de nombres)

InkOverlaySelectionResizingEventArgs

InkPicture.Selection

InkPicture.SelectionResized