Share via


PenInputPanelVisibleChangedEventHandler (Delegado)

Actualización: noviembre 2007

Representa el método que controla el evento VisibleChanged de un objeto PenInputPanel.

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

Sintaxis

'Declaración
Public Delegate Sub PenInputPanelVisibleChangedEventHandler ( _
    sender As Object, _
    e As PenInputPanelVisibleChangedEventArgs _
)
'Uso
Dim instance As New PenInputPanelVisibleChangedEventHandler(AddressOf HandlerMethod)
public delegate void PenInputPanelVisibleChangedEventHandler(
    Object sender,
    PenInputPanelVisibleChangedEventArgs e
)
public delegate void PenInputPanelVisibleChangedEventHandler(
    Object^ sender, 
    PenInputPanelVisibleChangedEventArgs^ e
)
/** @delegate */
public delegate void PenInputPanelVisibleChangedEventHandler(
    Object sender,
    PenInputPanelVisibleChangedEventArgs e
)
JScript no admite delegados.

Parámetros

Comentarios

El evento VisibleChanged se produce cuando el objeto PenInputPanel se ha mostrado o se ha ocultado.

Ejemplos

En este ejemplo de C# se crea un objeto PenInputPanel, thePenInputPanel y se asocia a un control InkEdit, theInkEdit. Agrega un controlador de eventos VisibleChanged, VisibleChanged_Event, al formulario de PenInputPanel. En el controlador de eventos, si el panel de entrada manuscrita está visible, su posición se modifica a las coordenadas de pantalla 100, 100 con una llamada al método MoveTo.

[C#]

//...

// Delcare the PenInputPanel object
PenInputPanel thePenInputPanel;

public Form1()
{
    //
    // Required for Windows Form Designer support
    //
    InitializeComponent();

    // Create and attach the new PenInputPanel to an InkEdit control.
    thePenInputPanel = new PenInputPanel(theInkEdit);

    // Add a PenInputPanelVisibleChanged event handler
    thePenInputPanel.VisibleChanged +=
        new PenInputPanelVisibleChangedEventHandler(VisibleChanged_Event);
}

//...

public void VisibleChanged_Event(object sender,
PenInputPanelVisibleChangedEventArgs e)
{
    // Make sure the object that generated
    // the event is a PenInputPanel object
    if (sender is PenInputPanel)
    {
        PenInputPanel theSenderPanel = (PenInputPanel)sender;

        // If the panel has become visible...
        if (e.NewVisibility)
        {
            // Move the pen input panel to
            // screen position 100, 100
            theSenderPanel.MoveTo(100, 100);
        }
    }
}

En este ejemplo de Microsoft® Visual Basic® .NET se crea un objeto PenInputPanel, thePenInputPanel y se asocia a un control InkEdit, theInkEdit. Agrega un controlador de eventos VisibleChanged, VisibleChanged_Event, al formulario de PenInputPanel. En el controlador de eventos, si el panel de entrada manuscrita está visible, su posición se modifica a las coordenadas de pantalla 100, 100 con una llamada al método MoveTo.

[Visual Basic]

'...

' Declare the PenInputPanel object
Dim thePenInputPanel As PenInputPanel

Public Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    ' Create and attach the new PenInputPanel to an InkEdit control.
    thePenInputPanel = New PenInputPanel(theInkEdit)

    ' Add a PenInputPanelVisibleChanged event handler
    AddHandler thePenInputPanel.VisibleChanged, _
               AddressOf VisibleChanged_Event
End Sub 'New

'...

Public Sub VisibleChanged_Event(sender As Object, e As _
                                PenInputPanelVisibleChangedEventArgs)
    ' Make sure the object that generated
    ' the event is a PenInputPanel object
    If TypeOf sender Is PenInputPanel Then
       Dim theSenderPanel As PenInputPanel = CType(sender, PenInputPanel)

       ' If the panel has become visible...
       If e.NewVisibility Then
          ' Move the pen input panel to
          ' screen position 100, 100
          theSenderPanel.MoveTo(100, 100)
       End If
    End If
End Sub 'VisibleChanged_Event

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

Microsoft.Ink (Espacio de nombres)

PenInputPanel.OnVisibleChanged