取得選定之 Strokes 集合在 SelectionMoved 事件引發之前的週框。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public ReadOnly Property OldSelectionBoundingRect As Rectangle
'用途
Dim instance As InkOverlaySelectionMovedEventArgs
Dim value As Rectangle
value = instance.OldSelectionBoundingRect
public Rectangle OldSelectionBoundingRect { get; }
public:
property Rectangle OldSelectionBoundingRect {
Rectangle get ();
}
/** @property */
public Rectangle get_OldSelectionBoundingRect()
public function get OldSelectionBoundingRect () : Rectangle
屬性值
型別:System.Drawing.Rectangle
選定的 Strokes 集合在 SelectionMoved 事件引發之前的週框。
備註
OldSelectionBoundingRect 屬性會取得選定的 Strokes 集合在 SelectionMoved 事件引發之前的所在位置。
範例
在這個範例中,SelectionMoved 事件處理常式會在選取範圍移動之後檢查它。如果選定的 Strokes 集合已移動,使選取範圍的任何部分離開視窗左方或上方,則選取範圍會移回其原始位置。
Private Sub mInkObject_SelectionMoved(ByVal sender As Object, ByVal e As InkOverlaySelectionMovedEventArgs)
' mInkObject can be InkOverlay or InkPicture
Dim newBounds As Rectangle = mInkObject.Selection.GetBoundingBox()
' Check if we have gone off the left or top sides of the window.
If (newBounds.Left < 0 Or newBounds.Top < 0) Then
' Move to back to original spot
mInkObject.Selection.Move(e.OldSelectionBoundingRect.Left - newBounds.Left, _
e.OldSelectionBoundingRect.Top - newBounds.Top)
' Trick to insure that selection handles are updated
mInkObject.Selection = mInkObject.Selection
End If
End Sub
private void mInkObject_SelectionMoved(object sender, InkOverlaySelectionMovedEventArgs e)
{
// mInkObject can be InkOverlay or InkPicture
Rectangle newBounds = mInkObject.Selection.GetBoundingBox();
// Check if we have gone off the left or top sides of the window.
if (newBounds.Left < 0 || newBounds.Top < 0)
{
// Move to back to original spot
mInkObject.Selection.Move(e.OldSelectionBoundingRect.Left - newBounds.Left,
e.OldSelectionBoundingRect.Top - newBounds.Top);
// Trick to insure that selection handles are updated
mInkObject.Selection = mInkObject.Selection;
}
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0
請參閱
參考
InkOverlaySelectionMovedEventArgs 類別