StylusButtonCollection.GetStylusButtonByGuid Method
Gets the StylusButton that the specified GUID identifies.
Assembly: PresentationCore (in PresentationCore.dll)
Parameters
- guid
- Type: System.Guid
The Guid that specifies the desired StylusButton.
The StylusPointProperties class contains a StylusPointProperty for the tip and barrel buttons on a tablet pen. Use the Id property to get the GUID associated with a button.
The following example demonstrates how to get the StylusButtonState of the barrel button.
void textbox1_StylusInRange(object sender, StylusEventArgs e) { StylusButtonCollection buttons = e.StylusDevice.StylusButtons; StylusButton barrelButton = buttons.GetStylusButtonByGuid(StylusPointProperties.BarrelButton.Id); if (barrelButton != null) { textbox1.AppendText(barrelButton.StylusButtonState.ToString()); } textbox1.AppendText("\r\n"); }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.