CursorButton.Id, propriété
Mise à jour : November 2007
Obtient l'identificateur de l'objet CursorButton.
Espace de noms : Microsoft.Ink
Assembly : Microsoft.Ink (dans Microsoft.Ink.dll)
Syntaxe
'Déclaration
Public ReadOnly Property Id As Guid
'Utilisation
Dim instance As CursorButton
Dim value As Guid
value = instance.Id
public Guid Id { get; }
public:
property Guid Id {
Guid get ();
}
/** @property */
public Guid get_Id()
public function get Id () : Guid
Valeur de propriété
Type : System.Guid
Identificateur de l'objet CursorButton.
Notes
Remarque : |
---|
L'identificateur d'un objet CursorButton reste constant, ce qui signifie qu'il n'est jamais modifié. |
Exemples
Cet exemple C# retourne un rapport sur les attributs de tous les curseurs rencontrés par l'objet InkCollector passé en tant que paramètre. Il inclut des informations relatives au CursorButton, telles que la propriété Id.
using Microsoft.Ink;
//. . .
public string CursorReport(InkCollector theInkCollector)
{
string theReport = "The InkCollector has encountered the following cursors so far:" + Environment.NewLine;
// Get the Cursors collection from the InkCollector
Microsoft.Ink.Cursors theCursors = theInkCollector.Cursors;
// Prevent changes to the collection while we iterate over it.
lock( theCursors.SyncRoot )
{
theReport += "Count of cursors: " + theCursors.Count + Environment.NewLine + Environment.NewLine ;
foreach (Microsoft.Ink.Cursor cursor in theCursors)
{
theReport += "Cursor Name: " + cursor.Name + Environment.NewLine;
theReport += "Cursor ToString: " + cursor.ToString() + Environment.NewLine;
theReport += "Tablet Name: " + cursor.Tablet.Name + Environment.NewLine;
theReport += "Cursor Id: " + cursor.Id.ToString() + Environment.NewLine;
theReport += "Cursor is inverted: " + cursor.Inverted.ToString() + Environment.NewLine;
theReport += "Cursor Buttons:" + Environment.NewLine;
foreach (CursorButton button in cursor.Buttons)
{
CursorButtonState theState = button.State;
theReport += " Button Name: " + button.Name + Environment.NewLine;
theReport += " State: " + button.State.ToString() + Environment.NewLine;
theReport += " Id: " + button.Id.ToString() + Environment.NewLine + Environment.NewLine;
}
}
}
return theReport;
}
Cet exemple Microsoft® Visual Basic® .NET retourne un rapport sur les attributs de tous les curseurs rencontrés par l'objet InkCollector passé comme paramètre. Il inclut des informations relatives au CursorButton, telles que la propriété Id.
Imports Microsoft.Ink
'. . .
Public Function CursorReport(ByVal theInkCollector As InkCollector) _
As String
Dim theReport As String = "The InkCollector has encountered " & _
"the following cursors so far:" & vbCrLf
' Get the Cursors collection from the InkCollector
Dim theCursors As Cursors = theInkCollector.Cursors
' Prevent changes to the collection while we iterate over it.
SyncLock theCursors.SyncRoot
theReport &= "Count of cursors: " & theCursors.Count & vbCrLf
Dim theCursor As Cursor
For Each theCursor In theCursors
theReport &= "Cursor Name: " & theCursor.Name & vbCrLf
theReport &= "Cursor ToString: " & theCursor.ToString() & _
vbCrLf
theReport &= "Tablet Name: " & theCursor.Tablet.Name & vbCrLf
theReport &= "Cursor Id: " & theCursor.Id.ToString() & vbCrLf
theReport &= "Cursor is inverted: " & _
theCursor.Inverted.ToString() & vbCrLf
theReport &= "Cursor Buttons:" & vbCrLf
Dim theButton As CursorButton
For Each theButton In theCursor.Buttons
Dim theState As CursorButtonState = theButton.State
theReport &= " Button Name: " & theButton.Name & vbCrLf
theReport &= " State: " & _
theButton.State.ToString() & vbCrLf
theReport &= " Id: " & theButton.Id.ToString() & _
vbCrLf & vbCrLf
Next
Next
End SyncLock
Return theReport
End Function
Plateformes
Windows Vista
Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Informations de version
.NET Framework
Pris en charge dans : 3.0