Proprietà GestureRecognizer.Enabled
Aggiornamento: novembre 2007
Ottiene o imposta un valore che indica se il riconoscimento del movimento è abilitato.
Spazio dei nomi: Microsoft.StylusInput
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Sintassi
'Dichiarazione
Public Property Enabled As Boolean
'Utilizzo
Dim instance As GestureRecognizer
Dim value As Boolean
value = instance.Enabled
instance.Enabled = value
public bool Enabled { get; set; }
public:
property bool Enabled {
bool get ();
void set (bool value);
}
/** @property */
public boolean get_Enabled()
/** @property */
public void set_Enabled(boolean value)
public function get Enabled () : boolean
public function set Enabled (value : boolean)
Valore proprietà
Tipo: System.Boolean
Valore che indica se il riconoscimento del movimento è abilitato.
Esempi
Questo esempio C# è un frammento tratto dal gestore dell'evento Load di un form che crea un oggetto GestureRecognizer, DynamicRenderer e due oggetti RealTimeStylus, associa gli oggetti in un modello RealTimeStylus sovrapposto e abilita il rendering dinamico, il riconoscimento del movimento e la raccolta dei dati della penna del Tablet PC tramite RealTimeStylus. L'oggetto GestureRecognizer viene impostato per il riconoscimento di movimenti a tratto singolo e per il riconoscimento dei movimenti dell'applicazioneRight, ChevronRight e ArrowRight. La proprietà WindowInputRectangle dell'oggetto RealTimeStylus primario viene impostata in modo esplicito per l'utilizzo dell'intero controllo a cui è associato l'oggetto RealTimeStylus. Il form stesso implementa l'interfaccia IStylusAsyncPlugin ed è associato all'oggetto RealTimeStylus.
using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;
// ...
// The panel where the tablet pen data is collected.
private System.Windows.Forms.Panel thePanel;
// Declare the RealTimeStylus objects, the GestureRecognizer plugin,
// and the DynamicRenderer plug-in.
private Microsoft.StylusInput.RealTimeStylus thePrimaryRealTimeStylus = null;
private Microsoft.StylusInput.RealTimeStylus theSecondaryRealTimeStylus = null;
private Microsoft.StylusInput.GestureRecognizer theGestureRecognizer = null;
private Microsoft.StylusInput.DynamicRenderer theDynamicRenderer = null;
// The form's Load event handler.
private void theForm_Load(object sender, System.EventArgs e)
{
// ...
// Create a DynamicRenderer attached to the drawing area ,
// and enable dynamic rendering.
this.theDynamicRenderer = new DynamicRenderer(this.thePanel);
this.theDynamicRenderer.Enabled = true;
// Create a GestureRecognizer, and set it to recognize single-stroke gestures.
this.theGestureRecognizer = new GestureRecognizer();
this.theGestureRecognizer.MaxStrokeCount = 1;
// Allow gesture recognition for specific gestures.
this.theGestureRecognizer.EnableGestures( new ApplicationGesture[]
{
ApplicationGesture.Right,
ApplicationGesture.ChevronRight,
ApplicationGesture.ArrowRight
} );
// Enable gesture recognition.
this.theGestureRecognizer.Enabled = true;
// Create the primary and secondary RealTimeStylus objects.
this.thePrimaryRealTimeStylus = new RealTimeStylus(this.thePanel);
this.theSecondaryRealTimeStylus = new RealTimeStylus();
// Add the secondary RealTimeStylus to the primary's asynchronous plug-in collection.
this.thePrimaryRealTimeStylus.AsyncPluginCollection.Add(
this.theSecondaryRealTimeStylus);
// Add the dynamic renderer to the primary's synchronous plug-in collection.
this.thePrimaryRealTimeStylus.SyncPluginCollection.Add(this.theDynamicRenderer);
// Add the gesture recognizer to the secondary's synchronous plug-in collection.
this.theSecondaryRealTimeStylus.SyncPluginCollection.Add(this.theGestureRecognizer);
// Add the form to the secondary's asynchronous plug-in colleciton.
this.theSecondaryRealTimeStylus.AsyncPluginCollection.Add(this);
// Set the input rectangle to the entire panel for the RealTimeStylus.
this.thePrimaryRealTimeStylus.WindowInputRectangle = new Rectangle(0,0,0,0);
// Enable the RealTimeStylus, which allows notifications to flow to the plug-ins.
this.thePrimaryRealTimeStylus.Enabled = true;
// ...
}
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