Поделиться через


InkOverlaySelectionMovedEventArgs.OldSelectionBoundingRect - свойство

Обновлен: Ноябрь 2007

Gets the bounding rectangle of the selected Strokes collection as it existed before the SelectionMoved event fired.

Пространство имен:  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
The bounding rectangle of the selected Strokes collection as it existed before the SelectionMoved event fired.

Заметки

The OldSelectionBoundingRect property gets the position that the selected Strokes collection was located in before the SelectionMoved event fired.

Примеры

In this example, an SelectionMoved event handler examines a selection after it has been moved. If the selected Strokes collection is moved so that any of the selection is off the left or top side of the window, then the selection is moved back to its original position.

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 Класс

InkOverlaySelectionMovedEventArgs - члены

Microsoft.Ink - пространство имен

InkOverlay

InkOverlay.SelectionMoved