InkOverlay オブジェクトの StrokesDeleted イベントを処理するメソッドを表します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink (Microsoft.Ink.dll 内)
構文
'宣言
Public Delegate Sub InkOverlayStrokesDeletedEventHandler ( _
sender As Object, _
e As EventArgs _
)
'使用
Dim instance As New InkOverlayStrokesDeletedEventHandler(AddressOf HandlerMethod)
public delegate void InkOverlayStrokesDeletedEventHandler(
Object sender,
EventArgs e
)
public delegate void InkOverlayStrokesDeletedEventHandler(
Object^ sender,
EventArgs^ e
)
/** @delegate */
public delegate void InkOverlayStrokesDeletedEventHandler(
Object sender,
EventArgs e
)
JScript では、デリゲートは使用できません。
パラメータ
- sender
型 : System.Object
このイベントのソース InkOverlay。
- e
型 : System.EventArgs
イベント データを格納している EventArgs オブジェクト。
解説
StrokesDeleted イベントは、Stroke オブジェクトが Ink プロパティから削除された後に発生します。
EventArgs クラスは、イベント データを格納していません。これは、イベントが発生するときに、イベント ハンドラに状態情報を渡さないイベントによって使用されます。
例
この例では、Stoke() イベント、および StrokesDeleted イベントにサブスクライブし、インクが描画されるコントロールの背景色を変更する方法を示します。
Stoke() イベントが発生するときに、EditingMode プロパティが調べられます。現在、インク モードになっている場合は、コントロールの背景色が白に変更されます。ストロークの消去時にも Stoke() イベントが発生するため、EditingMode プロパティをチェックする必要があります。
Private Sub mInkObject_Stroke3(ByVal sender As Object, ByVal e As InkCollectorStrokeEventArgs)
' If you are in inking mode, change background to white.
' (This event will also fire in Delete mode because the movement made by
' the eraser is considered a stroke.)
If (InkOverlayEditingMode.Ink = mInkObject.EditingMode) Then
mInkObject.AttachedControl.BackColor = Color.White
End If
End Sub
private void mInkObject_Stroke3(object sender, InkCollectorStrokeEventArgs e)
{
// If you are in inking mode, change background to white.
// (This event will also fire in Delete mode because the movement made by
// the eraser is considered a stroke.)
if (InkOverlayEditingMode.Ink == mInkObject.EditingMode)
{
mInkObject.AttachedControl.BackColor = Color.White;
}
}
StrokesDeleted イベントが発生するときに、Stokes() コレクションが調べられます。コレクションに Stroke オブジェクトがない (または消しゴムのストロークのみが残っている) 場合は、コントロールの背景色が灰色に変更されます。
Private Sub mInkObject_StrokesDeleted(ByVal sender As Object, ByVal e As EventArgs)
' Change the background to gray if there are no strokes.
' If the last stroke was deleted by an eraser, there will be one transparent
' stroke, which is the stroke made by the eraser itself.
If (mInkObject.Ink.Strokes.Count = 0 Or _
(mInkObject.Ink.Strokes.Count = 1 And _
mInkObject.Ink.Strokes(0).DrawingAttributes.Transparency = 255)) Then
mInkObject.AttachedControl.BackColor = Color.Gray
End If
End Sub
private void mInkObject_StrokesDeleted(object sender, EventArgs e)
{
// Change the background to gray if there are no strokes.
// If the last stroke was deleted by an eraser, there will be one transparent
// stroke, which is the stroke made by the eraser itself.
if (mInkObject.Ink.Strokes.Count == 0 ||
(mInkObject.Ink.Strokes.Count == 1 &&
mInkObject.Ink.Strokes[0].DrawingAttributes.Transparency == 255))
{
mInkObject.AttachedControl.BackColor = Color.Gray;
}
}
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0