Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Aggiornamento: novembre 2007
Ottiene o imposta un valore che indica se l'oggetto RealTimeStylus è abilitato.
Spazio dei nomi: Microsoft.StylusInput
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Sintassi
'Dichiarazione
Public Property Enabled As Boolean
'Utilizzo
Dim instance As RealTimeStylus
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
Se l'oggetto RealTimeStylus è abilitato.
Valore |
Significato |
|---|---|
true |
L'oggetto RealTimeStylus è abilitato e può raccogliere i dati dello stilo. |
false |
L'oggetto RealTimeStylus è disabilitato. I dati dello stilo non vengono raccolti. |
Note
Questa proprietà genera un'eccezione nelle condizioni seguenti.
L'oggetto RealTimeStylus viene eliminato.
Questa proprietà è impostata su un oggetto RealTimeStylus creato con il costruttore RealTimeStylus().
Il rettangolo di input della finestra dell'oggetto RealTimeStylus si sovrappone al rettangolo di input della finestra di un oggetto RealTimeStylus abilitato.
Non sono stati aggiunti plug-in all'oggetto RealTimeStylus.
Nota
È possibile rimuovere tutti i plug-in dall'oggetto RealTimeStylus mentre Enabled è true. La rimozione di tutti i plug-in non modifica il valore di Enabled.
Nota
L'impostazione della proprietà può provocare una chiamata rientrante quando viene utilizzata all'interno di determinati gestori di messaggi, generando risultati imprevisti. Prestare attenzione per evitare una chiamata rientrante durante la gestione di uno dei messaggi seguenti: WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_PAINT, WM_SYSCOMMAND se wParam è impostato su SC_HOTKEY o SC_TASKLIST e WM_SYSKEYDOWN (durante l'elaborazione delle combinazioni di tasti ALT-TAB o ALT-ESC). Questo problema è relativo alle applicazioni con modello di apartment a thread singolo.
Esempi
Questo esempio Microsoft Visual C# .NET è 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 del movimento dell'applicazioneApplicationGesture, ApplicationGesture e ApplicationGesture. La proprietà WindowInputRectangle dell'oggetto RealTimeStylus primario viene impostata in modo esplicito per utilizzare l'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