ToolTip.InitialDelay Proprietà

Definizione

Ottiene o imposta il tempo di attesa prima della visualizzazione della descrizione comando.

public:
 property int InitialDelay { int get(); void set(int value); };
public int InitialDelay { get; set; }
member this.InitialDelay : int with get, set
Public Property InitialDelay As Integer

Valore della proprietà

Int32

Intervallo di permanenza, in millisecondi, del puntatore su un controllo prima della visualizzazione della finestra della descrizione comando.

Esempio

Nell'esempio di codice seguente viene creata un'istanza della ToolTip classe e viene associata l'istanza all'oggetto Form in cui viene creata l'istanza. Il codice inizializza quindi le proprietà AutoPopDelaydi ritardo , InitialDelaye ReshowDelay. Inoltre, l'istanza della ToolTip classe imposta la ShowAlways proprietà su per true consentire la visualizzazione del testo della descrizione comando indipendentemente dal fatto che il modulo sia attivo. Infine, l'esempio associa il testo della descrizione comando a due controlli di una maschera, un oggetto Button e un oggetto CheckBox. L'esempio di codice richiede che il metodo definito nell'esempio si trovi all'interno di un Form oggetto che contiene un Button controllo denominato e un CheckBox controllo denominato button1 checkBox1, e che il metodo viene chiamato dal costruttore di Form.

// This example assumes that the Form_Load event handling method
// is connected to the Load event of the form.
void Form1_Load( Object^ sender, System::EventArgs^ e )
{
   // Create the ToolTip and associate with the Form container.
   ToolTip^ toolTip1 = gcnew ToolTip;
   
   // Set up the delays for the ToolTip.
   toolTip1->AutoPopDelay = 5000;
   toolTip1->InitialDelay = 1000;
   toolTip1->ReshowDelay = 500;
   // Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1->ShowAlways = true;
   
   // Set up the ToolTip text for the Button and Checkbox.
   toolTip1->SetToolTip( this->button1, "My button1" );
   toolTip1->SetToolTip( this->checkBox1, "My checkBox1" );
}
// This example assumes that the Form_Load event handling method
// is connected to the Load event of the form.
private void Form1_Load(object sender, System.EventArgs e)
{
   // Create the ToolTip and associate with the Form container.
   ToolTip toolTip1 = new ToolTip();

   // Set up the delays for the ToolTip.
   toolTip1.AutoPopDelay = 5000;
   toolTip1.InitialDelay = 1000;
   toolTip1.ReshowDelay = 500;
   // Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1.ShowAlways = true;
      
   // Set up the ToolTip text for the Button and Checkbox.
   toolTip1.SetToolTip(this.button1, "My button1");
   toolTip1.SetToolTip(this.checkBox1, "My checkBox1");
}
' This example assumes that the Form_Load event handling method
' is connected to the Load event of the form.
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
   ' Create the ToolTip and associate with the Form container.
   Dim toolTip1 As New ToolTip()
   
   ' Set up the delays for the ToolTip.
   toolTip1.AutoPopDelay = 5000
   toolTip1.InitialDelay = 1000
   toolTip1.ReshowDelay = 500
   ' Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1.ShowAlways = True
   
   ' Set up the ToolTip text for the Button and Checkbox.
   toolTip1.SetToolTip(Me.button1, "My button1")
   toolTip1.SetToolTip(Me.checkBox1, "My checkBox1")
End Sub

Commenti

Con la InitialDelay proprietà è possibile abbreviare o aumentare il tempo di ToolTip attesa prima di visualizzare una finestra Descrizione comando. Se il valore della InitialDelay proprietà è impostato su un valore troppo lungo per tutta la durata, l'utente dell'applicazione potrebbe non sapere che l'applicazione fornisce la Guida della descrizione comando. È possibile usare questa proprietà per assicurarsi che le descrizioni comandi dell'utente vengano visualizzate rapidamente riducendo il tempo specificato.

Il valore di questa proprietà non può superare 32767.

Se si vuole avere un modello di ritardo coerente per le finestre della descrizione comando, è possibile impostare la AutomaticDelay proprietà . La AutomaticDelay proprietà imposta le AutoPopDelayproprietà , ReshowDelaye InitialDelay sui valori iniziali in base a un singolo valore di ora. Ogni volta che la AutomaticDelay proprietà viene impostata, la InitialDelay proprietà viene impostata sullo stesso valore della AutomaticDelay proprietà . Dopo aver impostato la AutomaticDelay proprietà, è possibile impostare in modo indipendente la InitialDelay proprietà, sostituendo il valore predefinito.

Si applica a

Vedi anche