Proprietà StylusButtons.Count
Aggiornamento: novembre 2007
Ottiene il numero di pulsanti dello stilo.
Spazio dei nomi: Microsoft.StylusInput
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Sintassi
'Dichiarazione
Public ReadOnly Property Count As Integer
'Utilizzo
Dim instance As StylusButtons
Dim value As Integer
value = instance.Count
public int Count { get; }
public:
property int Count {
int get ();
}
/** @property */
public int get_Count()
public function get Count () : int
Valore proprietà
Tipo: System.Int32
Numero di pulsanti dello stilo.
Note
L'elenco di pulsanti fornito in questo insieme indica ciò che è supportato da un digitalizzatore e non necessariamente ciò che è presente sulla penna. È possibile determinare lo stato di un pulsante dello stilo specifico e verificarne la presenza, quando il plug-in riceve le notifiche StylusButtonDown e StylusButtonUp.
Esempi
In questo esempio Microsoft Visual C# .NET viene illustrato un gestore dell'evento per il metodo StylusInRange implementato in un form:
public class Form1 : Form, IStylusAsyncPlugin
{
private RealTimeStylus rts;
private DynamicRenderer dr;
private System.Windows.Forms.TextBox textBox1;
public Form1()
{
rts = new RealTimeStylus(this);
dr = new DynamicRenderer(this);
rts.SyncPluginCollection.Add(dr);
rts.AsyncPluginCollection.Add(this);
rts.Enabled = true;
dr.Enabled = true;
InitializeComponent();
}
// ...
public Microsoft.StylusInput.DataInterestMask DataInterest
{
get{return DataInterestMask.AllStylusData;}
}
public void StylusInRange(RealTimeStylus sender, StylusInRangeData data)
{
string sInverted = data.Stylus.Inverted ? "is inverted" : "is not inverted";
textBox1.AppendText(
string.Format("{0} in range; {1}; has {2} buttons:{3}",
data.Stylus.Name,
sInverted,
data.Stylus.Buttons.Count,
Environment.NewLine)
);
for (int i=0; i<data.Stylus.Buttons.Count; i++)
{
textBox1.AppendText(
string.Format(" {0}: {1}{2}",
i.ToString(),
data.Stylus.Buttons.GetName(i),
Environment.NewLine)
);
}
}
// ...
Piattaforme
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.
Informazioni sulla versione
.NET Framework
Supportato in: 3.0
Vedere anche
Riferimenti
Spazio dei nomi Microsoft.StylusInput
Microsoft.StylusInput.PluginData.StylusButtonDataBase