Share via


DefaultPanel Property

DefaultPanel Property

Gets or sets the default panel type used for input within the PenInputPanel object.

Declaration

[C++]

[propput] HRESULT DefaultPanel (
    [in] PanelType DefaultPanel);
[propget] HRESULT DefaultPanel (
    [out, retval] PanelType *DefaultPanel);

[Microsoft® Visual Basic® 6.0]

Public Property Get DefaultPanel() as PanelType
Public Property Let DefaultPanel ( _
    theDefaultPanel as PanelType)

Property Value

PanelType Which panel shows in the pen input panel by default.

This property is read/write.

Return Value

One of the valid PanelType values.

HRESULT value Description
S_OK Success. The parameter contains the default panel.
E_FAIL An unspecified error occurred.

Remarks

Note: The DefaultPanel property cannot be set to Inactive.

The Handwriting panel—also known as the writing pad—is the default input UI for a PenInputPanel.

If the value of this property is Default, then the PenInputPanel object uses the last panel type used for any pen input panel in any application. If all previous references to the pen input panel have been destroyed in all active applications, a new PenInputPanel object uses the Handwriting panel type.

If the panel is changed by setting the CurrentPanel property before the PenInputPanel object becomes active for the first time, a PanelChanged event occurs.

Setting the DefaultPanel property enables you to specify which type of panel shows by default in that instance of the PenInputPanel object. If the value of this property is Handwriting or Keyboard, then each time the panel is made visible, it uses the handwriting or keyboard panel type, respectively.

If you re-attach the PenInputPanel to a different control and change the DefaultPanel property when the focus changes to the new control, be sure to set the DefaultPanel property before setting the AttachedEditWindow property to ensure that the correct panel is displayed.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, InkEdit1. It then sets the keyboard to be the default input method for the pen input panel by setting the DefaultPanel property to PT_Keyboard.

' Declare a new PenInputPanel object
Dim thePenInputPanel As PenInputPanel

' Create the PenInputPanel
Set thePenInputPanel = New PenInputPanel

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

' Set the default panel to keyboard input
thePenInputPanel.DefaultPanel = PT_Keyboard

Applies To