SelectionMoving イベントの後に選択が移動する先の四角形を取得します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink (Microsoft.Ink.dll 内)
構文
'宣言
Public ReadOnly Property NewPixelRect As Rectangle
'使用
Dim instance As InkOverlaySelectionMovingEventArgs
Dim value As Rectangle
value = instance.NewPixelRect
public Rectangle NewPixelRect { get; }
public:
property Rectangle NewPixelRect {
Rectangle get ();
}
/** @property */
public Rectangle get_NewPixelRect()
public function get NewPixelRect () : Rectangle
プロパティ値
型 : System.Drawing.Rectangle
SelectionMoving イベントの後に選択が移動する先の四角形。
例
この例では、SelectionMoving イベント ハンドラが、移動される前に選択を調べます。一部がウィンドウの境界の外側になるように選択が移動される場合、イベント ハンドラは、選択された各 Stroke オブジェクトの Color プロパティを変更し、選択を赤で表示します。
Private Sub mInkObject_SelectionMoving(ByVal sender As Object, ByVal e As InkOverlaySelectionMovingEventArgs)
If e.NewPixelRect.Left < 0 Or e.NewPixelRect.Top < 0 Or _
e.NewPixelRect.Right > mInkObject.AttachedControl.ClientRectangle.Width Or _
e.NewPixelRect.Bottom > mInkObject.AttachedControl.ClientRectangle.Height Then
For Each stroke As Stroke In mInkObject.Selection
' change the stroke color
stroke.DrawingAttributes.Color = Color.Red
Next
End If
End Sub
private void mInkObject_SelectionMoving(object sender, InkOverlaySelectionMovingEventArgs e)
{
if (e.NewPixelRect.Left < 0 || e.NewPixelRect.Top < 0 ||
e.NewPixelRect.Right > mInkObject.AttachedControl.ClientRectangle.Width ||
e.NewPixelRect.Bottom > mInkObject.AttachedControl.ClientRectangle.Height)
{
foreach (Stroke stroke in mInkObject.Selection)
{
// change the stroke color
stroke.DrawingAttributes.Color = Color.Red;
}
}
}
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0
参照
参照
InkOverlaySelectionMovingEventArgs クラス