共用方式為


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-tw,VS.90).gif安全性注意事項:

如果在部分信任的情況下使用,除了 PenInputPanel 所需的權限之外,這個事件還需要 SecurityPermissionFlag.AllFlags (英文) 權限。如需詳細資訊,請參閱Security and Trust

範例

這個 Microsoft® Visual C#® 範例會建立 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® .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