共用方式為


InkOverlay.Painted Event

InkOverlay.Painted Event

Occurs when the InkOverlay object has completed redrawing itself.

Definition

Visual Basic .NET Public Event Painted As InkOverlayPaintedEventHandler
C# public event InkOverlayPaintedEventHandler Painted;
Managed C++ public: __event InkOverlayPaintedEventHandler Painted;

Remarks

The event handler receives an argument of type PaintEventArgs Leave Site that contains data about this event.

When you create an InkOverlayPaintedEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For performance reasons, the default event interest is off but is turned on automatically if you add an event handler.

Examples

[C#]

This C# example shows how you can count the number of times that an InkOverlay named theInkOverlay is painted.

using Microsoft.Ink;
//...
  private int paintCount = 0;
//...
  theInkOverlay.Painted += new InkOverlayPaintedEventHandler(inkOverlay_Painted);
//...
  private void inkOverlay_Painted(object sender, System.Windows.Forms.PaintEventArgs e)
  {
      paintCount++;
      System.Diagnostics.Debug.WriteLine("Painted " + paintCount.ToString() + " times.");
  }
//...

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example shows how you can count the number of times that an InkOverlay named theInkOverlay is painted.

Imports Microsoft.Ink
'...
    Private paintCount As Integer = 0
    Private WithEvents theInkOverlay As InkOverlay
'...

    Private Sub theInkOverlay_Painted(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) _
    Handles theInkOverlay.Painted
        paintCount = paintCount + 1
        System.Diagnostics.Debug.WriteLine("Painted " + paintCount.ToString() + " times.")
    End Sub
'...

See Also