共用方式為


PenInputPanelVisibleChangedEventHandler 委派

表示處理 PenInputPanel 物件之 VisibleChanged 事件的方法。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public Delegate Sub PenInputPanelVisibleChangedEventHandler ( _
    sender As Object, _
    e As PenInputPanelVisibleChangedEventArgs _
)
'用途
Dim instance As New PenInputPanelVisibleChangedEventHandler(AddressOf HandlerMethod)
public delegate void PenInputPanelVisibleChangedEventHandler(
    Object sender,
    PenInputPanelVisibleChangedEventArgs e
)
public delegate void PenInputPanelVisibleChangedEventHandler(
    Object^ sender, 
    PenInputPanelVisibleChangedEventArgs^ e
)
/** @delegate */
public delegate void PenInputPanelVisibleChangedEventHandler(
    Object sender,
    PenInputPanelVisibleChangedEventArgs e
)
JScript 不支援委派。

參數

備註

VisibleChanged 事件發生於 PenInputPanel 物件自行顯示或隱藏時。

範例

這個 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

請參閱

參考

Microsoft.Ink 命名空間

PenInputPanel.OnVisibleChanged