Share via


PanelChanged Event

PanelChanged Event

Occurs when the PenInputPanel object changes between layouts.

Declaration

[C++]

HRESULT PanelChanged (
    [in] PanelType NewPanelType
);

[Microsoft® Visual Basic® 6.0]

Public Event PanelChanged ( _
    NewPanelType as PanelType, _
);

Parameters

NewPanelType

[in] The new panel type used for input within the PenInputPanel object, after the PanelChanged event fires.

Remarks

When creating a PenInputPanel object, Handwriting is the default PanelType. If you change the panel by setting the CurrentPanel property before the pen input panel becomes active for the first time, a PanelChanged event occurs.

The PanelChanged event is not raised when the user changes between Lined and Boxed writing pads.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, theInkEdit. It then adds a PanelChanged event handler, thePenInputPanel_PanelChanged, to thePenInputPanel. The PanelChanged handler sets the text of the attached InkEdit control to a sentence indicating the new panel type.

' 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 = theInkEdit.hWnd

End Sub

Private Sub thePenInputPanel_PanelChanged(ByVal NewPanelType As _
                                          PenInputPanelLib.PanelType)
  If NewPanelType = PT_Handwriting Then
    theInkEdit.Text = "The panel has changed to Handwriting."
  ElseIf NewPanelType = PT_Keyboard Then
    theInkEdit.Text = "The panel has changed to Keyboard."
  Else
    theInkEdit.Text = "The panel type is unknown."
  End If
End Sub

Applies To