Freigeben über


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);
}
/** @event */
public void add_PanelChanged (PenInputPanelChangedEventHandler value)

/** @event */
public void remove_PanelChanged (PenInputPanelChangedEventHandler value)
In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

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

Example

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

PenInputPanel Class
PenInputPanel Members
Microsoft.Ink Namespace
PanelType
PenInputPanel.OnPanelChanged