Share via


PenInputPanel.Refresh (Método)

Actualización: noviembre 2007

Obsoleto. Actualiza y restaura las propiedades del PenInputPanel basadas en Panel de entrada de Tablet PC, coloca automáticamente el panel de entrada manuscrita y establece la interfaz de usuario en el panel predeterminado. PenInputPanel se ha reemplazado por Microsoft.Ink.TextInput.

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

Sintaxis

'Declaración
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
<UIPermissionAttribute(SecurityAction.Demand, Window := UIPermissionWindow.SafeTopLevelWindows)> _
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
Public Sub Refresh
'Uso
Dim instance As PenInputPanel

instance.Refresh()
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
[UIPermissionAttribute(SecurityAction.Demand, Window = UIPermissionWindow.SafeTopLevelWindows)]
[SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
public void Refresh()
[PermissionSetAttribute(SecurityAction::InheritanceDemand, Name = L"FullTrust")]
[UIPermissionAttribute(SecurityAction::Demand, Window = UIPermissionWindow::SafeTopLevelWindows)]
[SecurityPermissionAttribute(SecurityAction::Demand, Unrestricted = true)]
public:
void Refresh()
/** @attribute PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust") */
/** @attribute UIPermissionAttribute(SecurityAction.Demand, Window = UIPermissionWindow.SafeTopLevelWindows) */
/** @attribute SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true) */
public void Refresh()
public function Refresh()

Comentarios

El método Refresh restaura el panel predeterminado. Por ejemplo, si la propiedad DefaultPanel se establece en Keyboard y la propiedad CurrentPanel se establece en Handwriting, el método Refresh establece el panel de entrada manuscrita en Keyboard. Si la propiedad DefaultPanel se establece en Default, el método Refresh no cambia el panel de entrada manuscrita.

El método Refresh coloca automáticamente el panel de entrada manuscrita con respecto al control al que está asociado.

El método Refresh actualiza el panel de entrada manuscrita mediante la configuración del Panel de entrada de Tablet PC. Por ejemplo, puede realizar cambios en el objeto PenInputPanel y llamar después al método Refresh para restaurar la configuración a la que se copió del Panel de entrada.

El objeto PenInputPanel se actualiza automáticamente cada vez que cambia la configuración en el Panel de entrada.

Se produce un error si se llama al método Refresh mientras el panel de entrada manuscrita no tiene el foco.

Nota

Normalmente, no es necesario llamar al método Refresh, porque la funcionalidad se expresa durante la activación del panel de entrada manuscrita. Sin embargo, si la propiedad AutoShow se establece en false, se puede deshabilitar la activación del panel de entrada manuscrita. En ese caso, use el método Refresh para actualizar el objeto PenInputPanel.

Nota

Si se inicia con Microsoft® Windows® XP Tablet PC Edition 2005, el método Refresh queda obsoleto y no hace nada.

ms569778.alert_security(es-es,VS.90).gifNota de seguridad:

Si se usa en entornos de confianza parcial, este método necesita el permiso SecurityPermissionFlag.AllFlags, además de los permisos que requiere PenInputPanel. Vea Security and Trust para obtener más información.

Ejemplos

En este ejemplo de C# se asocia un objeto PenInputPanel, thePenInputPanel, a un control InkEdit, theInkEdit. Agrega un controlador de eventos VisibleChanged, VisibleChanged_Event, al formulario de PenInputPanel. En el controlador de eventos, si el objeto PenInputPanel está visible, su configuración se restaura a la del Panel de entrada llamando al método Refresh.

[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)
        {
            // Restore the pen input panel settings
            // from the global Input Panel
            theSenderPanel.Refresh();
        }
    }
}

En este ejemplo de Microsoft Visual Basic .NET se asocia un objeto PenInputPanel, thePenInputPanel, a un control InkEdit, theInkEdit. Agrega un controlador de eventos VisibleChanged, VisibleChanged_Event, al formulario de PenInputPanel. En el controlador de eventos, si el objeto PenInputPanel está visible, su configuración se restaura a la del Panel de entrada llamando al método Refresh.

[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
          ' Restore the pen input panel settings
          ' from the global Input Panel
            theSenderPanel.Refresh()
       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

PenInputPanel (Clase)

PenInputPanel (Miembros)

Microsoft.Ink (Espacio de nombres)

Otros recursos

Programming the Text Input Panel