Compartir a través de


InkPicture.SelectionChanged Event

Occurs when the selection of ink within the InkPicture control has changed, such as through alterations to the user interface, cut-and-paste procedures, or the Selection property.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Event SelectionChanged As InkOverlaySelectionChangedEventHandler
'Usage
Dim instance As InkPicture
Dim handler As InkOverlaySelectionChangedEventHandler

AddHandler instance.SelectionChanged, handler
public event InkOverlaySelectionChangedEventHandler SelectionChanged
public:
event InkOverlaySelectionChangedEventHandler^ SelectionChanged {
    void add (InkOverlaySelectionChangedEventHandler^ value);
    void remove (InkOverlaySelectionChangedEventHandler^ value);
}
/** @event */
public void add_SelectionChanged (InkOverlaySelectionChangedEventHandler value)

/** @event */
public void remove_SelectionChanged (InkOverlaySelectionChangedEventHandler value)
In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

Remarks

The event handler receives an argument of type EventArgsEventArgs, which contains no data.

Example

This C# example counts the number of selected Stroke objects of an InkPicture control, theInkPicture, and displays the count in a status bar, inkStatusBar.

[C#]

using Microsoft.Ink;
//...
  theInkPicture.SelectionChanged += new InkOverlaySelectionChangedEventHandler(theInkPicture_SelectionChanged);
//...
  private void theInkPicture_SelectionChanged(object sender, System.EventArgs e)
  {
      inkStatusBar.Text = theInkPicture.Selection.Count.ToString() + " strokes selected.";
  }
//...

This Microsoft® Visual Basic® .NET example counts the number of selected Stroke objects of an InkPicture control, theInkPicture, and displays the count in a status bar, inkStatusBar.

[Visual Basic]

Imports Microsoft.Ink
'...
    Private WithEvents theInkPicture As InkPicture
'...
    Private Sub theInkPicture_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
    Handles theInkPicture.SelectionChanged
        InkStatusBar.Text = theInkPicture.Selection.Count.ToString() + " strokes selected."
    End Sub
'...

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkPicture Class
InkPicture Members
Microsoft.Ink Namespace
InkPicture.Selection
InkPicture.SelectionChanging