共用方式為


InkOverlayPaintedEventHandler 委派

表示處理 InkOverlay 物件之 Painted 事件的方法。

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

語法

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

參數

備註

在建立 InkOverlayPaintedEventHandler 委派時,您要識別處理事件的方法。若要使事件與您的事件處理常式產生關聯,請將委派的執行個體加入至事件。除非您移除委派,否則每當事件發生時就會呼叫事件處理常式。基於效能考量,「Managed 程式碼」中相關事件的預設是關閉的,但會在您加入事件處理常式時自動開啟。

範例

在這個範例中,Painted 事件處理常式是用於在筆墨畫布上繪製浮水印。

Private Sub mInkObject_Painted(ByVal sender As Object, ByVal e As PaintEventArgs)
    Const X As Integer = 12
    Const Y As Integer = 12
    Const COMPANY As String = "Graphic Design Institute"
    Const WEB_SITE As String = "http://www.graphicdesigninstitute.com/"

    Dim cFont As Font = New Font("Arial", 18)
    Dim wFont As Font = New Font("Arial", 9)
    Dim cSize As SizeF = e.Graphics.MeasureString(COMPANY, cFont)

    e.Graphics.DrawString(COMPANY, cFont, Brushes.Wheat, X, Y)
    e.Graphics.DrawString(WEB_SITE, wFont, Brushes.SlateGray, X, cSize.Height + Y)
End Sub
private void mInkObject_Painted(object sender, PaintEventArgs e)
{
    const int X = 12;
    const int Y = 12;
    const string COMPANY = "Graphic Design Institute";
    const string WEB_SITE = "http://www.graphicdesigninstitute.com/";

    Font cFont = new Font("Arial", 18);
    Font wFont = new Font("Arial", 9);
    SizeF cSize = e.Graphics.MeasureString(COMPANY, cFont);

    e.Graphics.DrawString(COMPANY, cFont, Brushes.Wheat, X, Y);
    e.Graphics.DrawString(WEB_SITE, wFont, Brushes.SlateGray, X, cSize.Height + Y);
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

Microsoft.Ink 命名空間

InkOverlayPaintingEventHandler