Condividi tramite


Metodo PenInputPanel.Refresh

Aggiornamento: novembre 2007

Obsoleto. Aggiorna e ripristina le proprietà PenInputPanel in base al Pannello input penna di Tablet PC, posiziona automaticamente il pannello input penna e imposta l'interfaccia utente sul pannello predefinito. L'oggetto PenInputPanel è stato sostituito dall'oggetto Microsoft.Ink.TextInput.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
<UIPermissionAttribute(SecurityAction.Demand, Window := UIPermissionWindow.SafeTopLevelWindows)> _
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
Public Sub Refresh
'Utilizzo
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()

Note

Il metodo Refresh ripristina il pannello predefinito. Ad esempio, se la proprietà DefaultPanel è impostata su Keyboard e la proprietà CurrentPanel è impostata su Handwriting, il metodo Refresh imposta il pannello input penna su Keyboard. Se la proprietà DefaultPanel è impostata su Default, il metodo Refresh non modifica il pannello input penna.

Il metodo Refresh posiziona automaticamente il pannello input penna rispetto al controllo al quale è associato.

Il metodo Refresh aggiorna il pannello input penna tramite le impostazioni del Pannello input penna di Tablet PC. Ad esempio, è possibile apportare modifiche all'oggetto PenInputPanel, quindi chiamare l'oggetto Refresh per ripristinare le impostazioni su quelle copiate dal Pannello input penna.

L'oggetto PenInputPanel viene aggiornato automaticamente tutte le volte che le impostazioni del Pannello input penna vengono modificate.

Se il metodo Refresh viene chiamato quando il pannello input penna non dispone dello stato attivo, viene generato un errore.

Nota

Generalmente, non è necessario chiamare l'oggetto Refresh, perché la funzionalità viene espressa durante l'attivazione del pannello input penna. Tuttavia, se la proprietà AutoShow è impostata su false, è possibile disattivare il pannello input penna. In tal caso, utilizzare il metodo Refresh per aggiornare l'oggetto PenInputPanel.

Nota

A partire da Microsoft® Windows® XP Tablet PC Edition 2005, il metodo Refresh risulta obsoleto e non esegue nessuna operazione.

ms569778.alert_security(it-it,VS.90).gifNota sulla sicurezza:

Se utilizzato in attendibilità parziale, questo metodo richiede l'autorizzazione SecurityPermissionFlag.AllFlags, oltre alle autorizzazioni richieste dall'oggetto PenInputPanel. Per ulteriori informazioni, vedere Security and Trust.

Esempi

In questo esempio di C# viene associato un oggetto PenInputPanel, thePenInputPanel, a un controllo InkEdit, theInkEdit. Viene aggiunto un gestore eventi VisibleChanged, VisibleChanged_Event, al form dell'oggetto PenInputPanel. Nel gestore eventi, se l'oggetto PenInputPanel è visibile, le relative impostazioni vengono ripristinate in base a quelle del Pannello input penna chiamando il metodo 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();
        }
    }
}

In questo esempio di Microsoft Visual Basic .NET viene associato un oggetto PenInputPanel, thePenInputPanel, a un controllo InkEdit, theInkEdit. Viene aggiunto un gestore eventi VisibleChanged, VisibleChanged_Event, al form dell'oggetto PenInputPanel. Nel gestore eventi, se l'oggetto PenInputPanel è visibile, le relative impostazioni vengono ripristinate in base a quelle del Pannello input penna chiamando il metodo 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

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

PenInputPanel Classe

Membri PenInputPanel

Spazio dei nomi Microsoft.Ink

Altre risorse

Programming the Text Input Panel