PenInputPanel.DefaultPanel Property

PenInputPanel.DefaultPanel Property

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

Definition

Visual Basic .NET Public Property DefaultPanel As PanelType
C# public PanelType DefaultPanel { get; set; }
Managed C++ public: __property PanelType* get_DefaultPanel();
public: __property void set_DefaultPanel(PanelType*);

Property Value

Microsoft.Ink.PanelType. A member of the PanelType enumeration.

This property is read/write. This property has no default value.

Default0 Specifies the PenInputPanel object displays 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 pen input panel will use the handwriting panel type.
Inactive1 Specifies the PenInputPanel object does not accept input. This value is returned by the CurrentPanel property when the panel window is owned by another instance of the PenInputPanel object. This value is also returned if the panel window has not yet been activated.
Handwriting2 Specifies the PenInputPanel object displays the default handwriting panel for the current input language.
Keyboard3 Specifies the PenInputPanel object displays the default keyboard panel for the current input language.

Exceptions

COMException Leave Site:
ObjectDisposedException Leave Site: The PenInputPanel object is disposed.

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 object.

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.

Examples

[C#]

This C# example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, theInkEdit. It then sets the keyboard to be the default input method for the pen input panel by setting the DefaultPanel property to Keyboard.

//...

// Declare, create, and attach a new PenInputPanel to an InkEdit control
PenInputPanel thePenInputPanel = new PenInputPanel(theInkEdit);

// Set the default panel to keyboard input
thePenInputPanel.DefaultPanel = PanelType.Keyboard;

[Visual Basic .NET]

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

' Declare, create, and attach a new PenInputPanel to an InkEdit control
Dim thePenInputPanel As New PenInputPanel(theInkEdit)

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

See Also