StylusButtonCollection.GetStylusButtonByGuid(Guid) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient le StylusButton GUID spécifié qui identifie.
public:
System::Windows::Input::StylusButton ^ GetStylusButtonByGuid(Guid guid);
public System.Windows.Input.StylusButton GetStylusButtonByGuid(Guid guid);
member this.GetStylusButtonByGuid : Guid -> System.Windows.Input.StylusButton
Public Function GetStylusButtonByGuid (guid As Guid) As StylusButton
Paramètres
- guid
- Guid
Qui Guid spécifie le souhaité StylusButton.
Retours
GUID StylusButton spécifié.
Exemples
L’exemple suivant montre comment obtenir le StylusButtonStatebarrel buttonfichier .
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");
}
Private Sub textbox1_StylusInRange(ByVal sender As Object, ByVal e As StylusEventArgs)
Dim buttons As StylusButtonCollection = e.StylusDevice.StylusButtons
Dim barrelButton As StylusButton = buttons.GetStylusButtonByGuid(StylusPointProperties.BarrelButton.Id)
If Not barrelButton Is Nothing Then
textbox1.AppendText(barrelButton.StylusButtonState.ToString())
End If
textbox1.AppendText(vbCr & vbLf)
End Sub
Remarques
La StylusPointProperties classe contient une StylusPointProperty pour les boutons de pointe et de tonneau sur un stylet de tablette. Utilisez la Id propriété pour obtenir le GUID associé à un bouton.