ToolTip.AutoPopDelay Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur periode waktu TipsAlat tetap terlihat jika penunjuk stasioner pada kontrol dengan teks TipsAlat yang ditentukan.
public:
property int AutoPopDelay { int get(); void set(int value); };
public int AutoPopDelay { get; set; }
member this.AutoPopDelay : int with get, set
Public Property AutoPopDelay As Integer
Nilai Properti
Periode waktu, dalam milidetik, bahwa ToolTip tetap terlihat ketika pointer stasioner pada kontrol. Pada Windows 11, nilai default menyebabkan ToolTip tetap terlihat tanpa batas waktu.
Contoh
Contoh kode berikut membuat instans ToolTip kelas dan mengaitkan instans dengan Form instans yang dibuat di dalamnya. Kode kemudian menginisialisasi properti AutoPopDelaypenundaan , , InitialDelaydan ReshowDelay. Selain itu, instans ToolTipShowAlways kelas mengatur properti untuk true mengaktifkan teks TipsAlat yang akan ditampilkan terlepas dari apakah formulir aktif. Terakhir, contoh mengaitkan teks TipsAlat dengan dua kontrol pada formulir, Button dan CheckBox. Contoh kode mengharuskan metode yang ditentukan dalam contoh terletak di dalam Form yang berisi Button kontrol bernama button1 dan CheckBox kontrol bernama checkBox1, dan bahwa metode dipanggil dari konstruktor .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
Keterangan
Properti AutoPopDelay memungkinkan Anda mempersingkat atau memperpanjang waktu ToolTip jendela ditampilkan saat penunjuk berada di kontrol. Misalnya, jika Anda menampilkan Bantuan ekstensif di jendela TipsAlat, Anda dapat meningkatkan nilai properti ini untuk memastikan bahwa pengguna memiliki waktu yang cukup untuk membaca teks.
Jika Anda ingin memiliki pola penundaan yang konsisten untuk jendela TipsAlat, Anda dapat mengatur AutomaticDelay properti . Properti AutomaticDelay mengatur AutoPopDelayproperti , ReshowDelay, dan InitialDelay ke nilai awal berdasarkan satu nilai. Setiap kali AutomaticDelay properti diatur, AutoPopDelay properti diatur ke 10 kali AutomaticDelay nilai properti. AutomaticDelay Setelah properti diatur, Anda dapat mengatur AutoPopDelay properti secara independen, mengesampingkan nilai default.
Perilaku properti ini bervariasi menurut versi Windows:
- Pada Windows 10, waktu maksimum Anda dapat menunda popup adalah 5000 milidetik. Nilai yang lebih besar dari 5000 ms dijepit hingga 5000 ms.
- Pada Windows 11, nilai default menyebabkan tipsalat tetap terlihat tanpa batas waktu. Saat diatur ke nilai kustom, tidak ada batas 5000 mdtk, dan tipsalat ditampilkan selama durasi yang ditentukan.
Untuk durasi yang lebih lama atau kontrol yang tepat saat TipsAlat ditampilkan, gunakan metode .Show