ToolTip.ReshowDelay 屬性

定義

取得或設定當指標從某個控制項移動到另一個控制項時,在後續工具提示視窗出現之前,必須經過的時間長度。

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

屬性值

Int32

後續工具提示視窗出現之前經過的時間長度 (以毫秒為單位)。

範例

下列程式碼範例會建立 類別的實例, ToolTip 並將 實例與 Form 實例建立所在的 相關聯。 然後,程式碼會初始化延遲屬性 AutoPopDelayInitialDelayReshowDelay 。 此外,類別的 ToolTip 實例會將 屬性設定 ShowAlwaystrue ,以允許顯示工具提示文字,而不論表單是否為使用中。 最後,此範例會將 ToolTip 文字與表單上的兩個控制項建立關聯, Button 以及 CheckBox 。 程式碼範例會要求範例中定義的 方法位於 內 Form ,其中包含 Button 名為 button1 的控制項和 CheckBox 名為 checkBox1, 的控制項,以及從 的 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

備註

ReshowDelay使用 屬性,您可以縮短或延長在顯示先前工具提示視窗之後顯示工具提示視窗之前所等候的時間 ToolTip 。 第一次顯示工具提示視窗時,屬性的值 InitialDelay 會用來判斷在一開始顯示工具提示視窗之前要套用的延遲。 目前顯示工具提示視窗,且使用者將指標移至另一個顯示工具提示視窗的控制項時,會先使用 屬性的值 ReshowDelay ,再顯示新控制項的工具提示。 上一個控制項的工具提示視窗仍必須顯示,才能使用屬性中指定的 ReshowDelay 延遲;否則 InitialDelay 會使用 屬性值。

如果您想要有工具提示視窗的一致延遲模式,您可以設定 AutomaticDelay 屬性。 屬性會 AutomaticDelay 根據單一時間值,將 AutoPopDelayReshowDelayInitialDelay 屬性設定為初始值。 每次設定屬性時 AutomaticDelayReshowDelay 屬性都會設定為屬性值的 AutomaticDelay 1/5。 AutomaticDelay設定屬性之後,您可以獨立設定 ReshowDelay 屬性,覆寫預設值。

適用於

另請參閱