PenInputPanelChangedEventHandler Delegate
Represents the method that handles the PanelChanged event of a PenInputPanel object.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public Delegate Sub PenInputPanelChangedEventHandler ( _
sender As Object, _
e As PenInputPanelChangedEventArgs _
)
'Usage
Dim instance As New PenInputPanelChangedEventHandler(AddressOf HandlerMethod)
public delegate void PenInputPanelChangedEventHandler(
Object sender,
PenInputPanelChangedEventArgs e
)
public delegate void PenInputPanelChangedEventHandler(
Object^ sender,
PenInputPanelChangedEventArgs^ e
)
JScript does not support delegates.
Parameters
sender
Type: System.ObjectThe source PenInputPanel object of this event.
e
Type: Microsoft.Ink.PenInputPanelChangedEventArgsThe PenInputPanelChangedEventArgs object that contains the event data.
Remarks
When creating a PenInputPanel object, the PanelType panel is the default panel. If the panel is changed by setting the CurrentPanel property before the pen input panel becomes active for the first time, a PanelChanged event occurs.
Examples
This C# example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, theInkEdit. The example 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. The example 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