PenInputPanel.VisibleChanged 事件

已否决。当 PenInputPanel 对象已显示或隐藏自身时发生。PenInputPanel 已由 Microsoft.Ink.TextInput 替换。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Event VisibleChanged As PenInputPanelVisibleChangedEventHandler
用法
Dim instance As PenInputPanel
Dim handler As PenInputPanelVisibleChangedEventHandler

AddHandler instance.VisibleChanged, handler
public event PenInputPanelVisibleChangedEventHandler VisibleChanged
public:
 event PenInputPanelVisibleChangedEventHandler^ VisibleChanged {
    void add (PenInputPanelVisibleChangedEventHandler^ value);
    void remove (PenInputPanelVisibleChangedEventHandler^ value);
}
/** @event */
public void add_VisibleChanged (PenInputPanelVisibleChangedEventHandler value)
/** @event */
public void remove_VisibleChanged (PenInputPanelVisibleChangedEventHandler value)
JScript 不支持事件。

备注

事件处理程序接收 PenInputPanelVisibleChangedEventArgs 类型的参数,该参数包含有关此事件的数据。

会引发 VisibleChanged 事件的情况如下:

但是,当悬停目标展开以显示整个 PenInputPanel 对象的 UI 时,不会引发该事件。

ms567754.alert_security(zh-cn,VS.90).gif安全说明:

如果在部分信任环境下使用,则除了 PenInputPanel 所需的权限以外,该事件还需要 SecurityPermissionFlag.AllFlags 权限。有关更多信息,请参见Security and Trust

示例

此 Microsoft(R) Visual C#(R) 示例创建 PenInputPanel 对象 thePenInputPanel,并将它附加到 InkEdit 控件 theInkEdit。它将一个 VisibleChanged 事件处理程序 VisibleChanged_Event 添加到 PenInputPanel 的窗体。在该事件处理程序中,如果笔输入面板 可见,则通过调用 MoveTo 方法将其位置更改为屏幕坐标 100, 100 所指示的位置。

[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 PenInputPanelVisibleChanged 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)
        {
            // Move the pen input panel to
            // screen position 100, 100
            theSenderPanel.MoveTo(100, 100);
        }
    }
}

此 Microsoft Visual Basic(R) .NET 示例创建 PenInputPanel 对象 thePenInputPanel,并将它附加到 InkEdit 控件 theInkEdit。它将一个 VisibleChanged 事件处理程序 VisibleChanged_Event 添加到 PenInputPanel 的窗体。在该事件处理程序中,如果笔输入面板 可见,则通过调用 MoveTo 方法将其位置更改为屏幕坐标 100, 100 所指示的位置。

[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 PenInputPanelVisibleChanged 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
          ' Move the pen input panel to
          ' screen position 100, 100
          theSenderPanel.MoveTo(100, 100)
       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.OnVisibleChanged