Compartir a través de


Refresh Method

Refresh Method

Updates and restores the PenInputPanel properties based on Tablet PC Input Panel settings, automatically positions the pen input panel, and sets the user interface to the default panel.

Declaration

[C++]

HRESULT Refresh ();

[Microsoft® Visual Basic® 6.0]

Public Sub Refresh ()

Parameters

This method takes no parameters.

Return Value

HRESULT value Description
S_OK Success.
E_UNEXPECTED Unexpected parameter or property type.
E_FAIL An unspecified error occurred.

Remarks

The Refresh method restores the default panel. For example, if the DefaultPanel property is set to Keyboard and the CurrentPanel property is set to Handwriting, the Refresh method sets the pen input panel to Keyboard. If the DefaultPanel property is set to Default, the Refresh method does not change the pen input panel.

The Refresh method automatically positions the pen input panel relative to the control to which it is attached.

The Refresh method updates the pen input panel using the Input Panel settings. For instance, you can make changes to the PenInputPanel object, then call Refresh to restore the settings to those copied from the Input Panel.

The PenInputPanel object is updated automatically whenever the Input Panel settings change.

Calling Refresh while the pen input panel does not have focus will generate an error.

Note: Normally, you wont need to call Refresh since all of the above is executed during activation of the pen input panel. However, if the AutoShow property is set to FALSE, you can disable activation of the pen input panel. Therefore, the Refresh method is needed.

Examples

[Visual Basic 6.0]

This Visual Basic 6.0 example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, InkEdit1. It adds a VisibleChanged event handler, VisibleChanged_Event, to the form for the PenInputPanel. In the event handler, if the pen input panel is visible, its settings are restored to those of the Input Panel by calling the Refresh method.

' Declare a new PenInputPanel object
Dim WithEvents thePenInputPanel As PenInputPanel

Private Sub Form_Load()
' Create the PenInputPanel
Set thePenInputPanel = New PenInputPanel

' Attach the PenInputPanel to an InkEdit control
thePenInputPanel.AttachedEditWindow = InkEdit1.hWnd

End Sub

Private Sub thePenInputPanel_VisibleChanged(ByVal NewVisibility As Boolean)
' If the panel has become visible...
If NewVisibility Then
' Restore the pen input panel settings
' from the global Input Panel
thePenInputPanel.Refresh
End If
End Sub

Applies To