Поделиться через


PenInputPanel.CurrentPanel - свойство

Обновлен: Ноябрь 2007

Deprecated. Gets or sets which panel type is currently being used for input within the PenInputPanel object. PenInputPanel has been replaced by Microsoft.Ink.TextInput.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Property CurrentPanel As PanelType
'Применение
Dim instance As PenInputPanel
Dim value As PanelType

value = instance.CurrentPanel

instance.CurrentPanel = value
public PanelType CurrentPanel { get; set; }
public:
property PanelType CurrentPanel {
    PanelType get ();
    void set (PanelType value);
}
/** @property */
public PanelType get_CurrentPanel()
/** @property */
public  void set_CurrentPanel(PanelType value)
public function get CurrentPanel () : PanelType
public function set CurrentPanel (value : PanelType)

Значение свойства

Тип: Microsoft.Ink.PanelType
One of the PanelType values representing the panel type currently used for input within the PenInputPanel object. The Handwriting panel type is the default value.

Заметки

ms571976.alert_note(ru-ru,VS.90).gifПримечание.

The CurrentPanel property cannot be set to Default or Inactive.

When you create a PenInputPanel object, the Handwriting panel—also known as the writing pad—is the default input UI.

If you change the panel by setting the CurrentPanel property before the PenInputPanel object becomes active for the first time, a PanelChanged event occurs.

The CurrentPanel property can only be set to either the Handwriting or Keyboard value of the PanelType enumeration. The CurrentPanel property can never be set to Default or Inactive.

The CurrentPanel property returns the Inactive enumeration value if the panel window is associated with another instance of the PenInputPanel object. Setting the CurrentPanel property raises an exception if the panel is inactive or if the panel type is invalid.

ms571976.alert_security(ru-ru,VS.90).gifПримечание о безопасности.

If using under partial trust, this property 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 attaches a VisibleChanged event handler, VisibleChanged_Event to thePenInputPanel. The event handler forces the pen input panel to display the keyboard panel whenever it becomes visible by setting the CurrentPanel property to Keyboard.

[C#]

//...

// Declare 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 VisibleChanged event handler
    thePenInputPanel.VisibleChanged +=
        new PenInputPanelVisibleChangedEventHandler(VisibleChanged_Event);
}

//...

public void VisibleChanged_Event(object sender,
                                 PenInputPanelVisibleChangedEventArgs e)
{
    // Make sure the object that generated
    // the event is a PenInputPanel object
    if (sender is PenInputPanel)
    {
        PenInputPanel theSenderPanel = (PenInputPanel)sender;

        // If the panel has become visible...
        if (e.NewVisibility)
        {
            // Always default to keyboard input
            if (theSenderPanel.CurrentPanel == PanelType.Handwriting)
            {
                theSenderPanel.CurrentPanel = PanelType.Keyboard;
            }
        }
    }
}

This Microsoft® Visual Basic® .NET example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, theInkEdit. It attaches a VisibleChanged event handler, VisibleChanged_Event to thePenInputPanel. The event handler forces the pen input panel to display the keyboard panel whenever it becomes visible by setting the CurrentPanel property to Keyboard.

[Visual Basic]

'...

' Declare the PenInputPanel object
Dim thePenInputPanel As PenInputPanel

Public Sub New()
    MyBase.New()

    ' Required for Windows Form Designer support
    InitializeComponent()

    ' Create and attach the new PenInputPanel to an InkEdit control.
    thePenInputPanel = New PenInputPanel(theInkEdit)

    ' Add a VisibleChanged event handler
    AddHandler thePenInputPanel.VisibleChanged, _
               AddressOf VisibleChanged_Event
End Sub 'New


'...
Public Sub VisibleChanged_Event(sender As Object, e As _
                                PenInputPanelVisibleChangedEventArgs)
    ' 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)

       ' If the panel has become visible...
       If e.NewVisibility Then
          ' Always default to keyboard input
          If theSenderPanel.CurrentPanel = PanelType.Handwriting Then
             theSenderPanel.CurrentPanel = PanelType.Keyboard
          End If
       End If
    End If
End Sub 'VisibleChanged_Event

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

PenInputPanel Класс

PenInputPanel - члены

Microsoft.Ink - пространство имен

PenInputPanel.DefaultPanel

PanelType