Partager via


GetStylusInfo

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns a StylusInfo object that gives information about the state of the stylus (or whichever device was responsible for the input event).

retval = eventargs.GetStylusInfo()

Return Value

Type: StylusInfo

Information about the state of the stylus.

Managed Equivalent

StylusDevice (a property, and not an exact equivalent)

Remarks

For a mouse, the following is returned in the StylusInfo:

Type = Mouse

IsInverted = False

Example

The following example demonstrates how to display the type of device that was used to create the current StylusPoint.

// Capture mouse movement when the left button is pressed, and create the stroke.
function InkPresenterMouseDown(sender,args)
{
  // Display the type of input device in a TextBlock.
  device.Text = args.GetStylusInfo().deviceType;
  
  inkPresenter.CaptureMouse();
  newStroke = agCtrl.content.createFromXaml('<Stroke/>');
  
  newStroke.StylusPoints.AddStylusPoints(args.GetStylusPoints(inkPresenter));
  inkPresenter.Strokes.Add(newStroke);
}

Applies To

MouseEventArgs