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


InkOverlay.Selection - свойство

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

Gets or sets the Strokes collection that is currently selected inside the InkOverlay control.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
<BrowsableAttribute(False)> _
Public Property Selection As Strokes
'Применение
Dim instance As InkOverlay
Dim value As Strokes

value = instance.Selection

instance.Selection = value
[BrowsableAttribute(false)]
public Strokes Selection { get; set; }
[BrowsableAttribute(false)]
public:
property Strokes^ Selection {
    Strokes^ get ();
    void set (Strokes^ value);
}
/** @property */
/** @attribute BrowsableAttribute(false) */
public Strokes get_Selection()
/** @property */
/** @attribute BrowsableAttribute(false) */
public  void set_Selection(Strokes value)
public function get Selection () : Strokes
public function set Selection (value : Strokes)

Значение свойства

Тип: Microsoft.Ink.Strokes
The Strokes collection that is currently selected inside the InkOverlay control. The default value is an empty Strokes collection.

Заметки

To get the bounding rectangle of the Strokes collection after it has been moved or resized, call the GetBoundingBox method of the Strokes collection returned by this property.

To get the bounding rectangle of of the Strokes collection before it was moved, handle the SelectionMoved event and get the OldSelectionBoundingRect property of the InkOverlaySelectionMovedEventArgs object.

To get the bounding rectangle of of the Strokes collection before it was resized, handle the SelectionResized event and get the OldSelectionBoundingRect property of the InkOverlaySelectionResizedEventArgs object.

Примеры

In this example, all strokes of the InkOverlay object are selected by setting the Selection property to the same Strokes collection used by the associated Ink object.

After the selection is made, the EditingMode property is set to Select.

The EditingMode property cannot be changed while the object is collecting ink. Because ink collection is handled on a separate thread from your application code, the CollectingInk property can change to true while your application code is operating under the assumption that it is still false. To handle this contingency, access to the EditingMode property should be contained within a try-catch block.

' Select all strokes
' mInkObject can be InkOverlay or InkPicture
Try
    If Not mInkObject.CollectingInk Then
        mInkObject.Selection = mInkObject.Ink.Strokes
        mInkObject.EditingMode = InkOverlayEditingMode.Select
    End If

Catch
    ' handle or rethrow
End Try
// Select all strokes
// mInkObject can be InkOverlay or InkPicture
try
{
    if (!mInkObject.CollectingInk)
    {
        mInkObject.Selection = mInkObject.Ink.Strokes;
        mInkObject.EditingMode = InkOverlayEditingMode.Select;
    }
}
catch
{
    // handle or rethrow
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

InkOverlay Класс

InkOverlay - члены

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

Strokes

Strokes.GetBoundingBox

InkOverlaySelectionMovedEventArgs.OldSelectionBoundingRect