PenInputPanel.PanelChanged Event
Deprecated. Occurs when the PenInputPanel object changes which panel type is currently being used for input. PenInputPanel has been replaced by Microsoft.Ink.TextInput.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public Event PanelChanged As PenInputPanelChangedEventHandler
'Usage
Dim instance As PenInputPanel
Dim handler As PenInputPanelChangedEventHandler
AddHandler instance.PanelChanged, handler
public event PenInputPanelChangedEventHandler PanelChanged
public:
event PenInputPanelChangedEventHandler^ PanelChanged {
void add (PenInputPanelChangedEventHandler^ value);
void remove (PenInputPanelChangedEventHandler^ value);
}
JScript does not support events.
Remarks
The event handler receives an argument of type PenInputPanelChangedEventArgs, containing data about this event.
When creating a PenInputPanel object, the Handwriting panel is the default panel type. If the panel is changed by setting the CurrentPanel property before pen input panel becomes active for the first time, a PanelChanged event occurs.
The PanelChanged event is not raised when the user changes between a PanelType panel used for multicharacter input, such as words, and a PanelType panel used for single character input.
Security Note: |
---|
If using under partial trust, this event requires SecurityPermissionFlag.AllFlags permission, in addition to the permissions required by PenInputPanel. See Security and Trust for more information. |
Examples
This C# example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, theInkEdit. It then adds a PanelChanged event handler to thePenInputPanel. The PanelChanged handler sets the text of the attached InkEdit control to a sentence containing the new panel type.
[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 PanelChanged event handler
thePenInputPanel.PanelChanged +=
new PenInputPanelChangedEventHandler(PanelChanged_Event);
}
//...
public void PanelChanged_Event(object sender,
PenInputPanelChangedEventArgs e)
{
// Make sure the object that generated
// the event is a PenInputPanel object
if (sender is PenInputPanel)
{
PenInputPanel theSenderPanel = (PenInputPanel)sender;
theSenderPanel.AttachedEditControl.Text = "The panel has changed to ";
theSenderPanel.AttachedEditControl.Text += e.NewPanelType.ToString();
}
}
This Microsoft® Visual Basic® .NET example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, theInkEdit. It then adds a PanelChanged event handler to thePenInputPanel. The PanelChanged handler sets the text of the attached InkEdit control to a sentence containing the new panel type.
[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 PanelChanged event handler
AddHandler thePenInputPanel.PanelChanged, AddressOf PanelChanged_Event
End Sub 'New
'...
Public Sub PanelChanged_Event(ByVal sender As Object, ByVal e As _
PenInputPanelChangedEventArgs)
' 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)
theSenderPanel.AttachedEditControl.Text = "The panel has changed to "
theSenderPanel.AttachedEditControl.Text += e.NewPanelType.ToString
End If
End Sub 'PanelChanged_Event
Platforms
Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0