PenInputPanel.PanelChanged - событие
Обновлен: Ноябрь 2007
Deprecated. Occurs when the PenInputPanel object changes which panel type is currently being used for input. PenInputPanel has been replaced by Microsoft.Ink.TextInput.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Event PanelChanged As PenInputPanelChangedEventHandler
'Применение
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)
JScript не поддерживает события.
Заметки
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.
Примечание о безопасности. |
---|
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. |
Примеры
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
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0