ToolTip.ReshowDelay 屬性

定義

取得或設定當指標從某個控制項移動到另一個控制項時,在後續工具提示視窗出現之前,必須經過的時間長度。Gets or sets the length of time that must transpire before subsequent ToolTip windows appear as the pointer moves from one control to another.

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

後續工具提示視窗出現之前經過的時間長度 (以毫秒為單位)。The length of time, in milliseconds, that it takes subsequent ToolTip windows to appear.

範例

下列程式碼範例會建立類別的實例 ToolTip ,並將實例與 Form 建立實例的建立關聯。The following code example creates an instance of the ToolTip class and associates the instance with the Form that the instance is created within. 然後,程式碼會初始化 delay 屬性 AutoPopDelayInitialDelayReshowDelayThe code then initializes the delay properties AutoPopDelay, InitialDelay, and ReshowDelay. 此外,類別的實例 ToolTip 會將屬性設定 ShowAlways 為, true 無論表單是否為使用中,都會顯示工具提示文字。In addition the instance of the ToolTip class sets the ShowAlways property to true to enable ToolTip text to be displayed regardless of whether the form is active. 最後,此範例會將工具提示文字與表單、和上的兩個控制項產生關聯 Button CheckBoxFinally, the example associates ToolTip text with two controls on a form, a Button and a CheckBox. 程式碼範例需要在包含名為之控制項的中 Form ,以及 Button button1 CheckBox 名為的控制項, checkBox1, 以及從的函式呼叫方法時 Form ,範例中所定義的方法。The code example requires that the method defined in the example is located within a Form that contains a Button control named button1 and a CheckBox control named checkBox1, and that the method is called from the constructor of the 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 工具提示視窗之前所等待的時間。With the ReshowDelay property, you can shorten or lengthen the time that the ToolTip waits before displaying a ToolTip window after a previous ToolTip window is displayed. 第一次顯示工具提示視窗時,屬性的值 InitialDelay 會用來決定要在一開始顯示工具提示視窗之前套用的延遲。The first time a ToolTip window is displayed, the value of the InitialDelay property is used to determine the delay to apply before initially showing the ToolTip window. 目前顯示工具提示視窗,且使用者將指標移至另一個顯示工具提示視窗的控制項時, ReshowDelay 會在顯示新控制項的工具提示之前使用屬性的值。When a ToolTip window is currently being displayed and the user moves the pointer to another control that displays a ToolTip window, the value of the ReshowDelay property is used before showing the ToolTip for the new control. 先前控制項的工具提示視窗仍然必須顯示,才能使用屬性中指定的延遲, ReshowDelay 否則會 InitialDelay 使用屬性值。The ToolTip window from the previous control must still be displayed in order for the delay specified in the ReshowDelay property to be used; otherwise the InitialDelay property value is used.

如果您想要讓工具提示視窗擁有一致的延遲模式,可以設定 AutomaticDelay 屬性。If you want to have a consistent delay pattern for ToolTip windows, you can set the AutomaticDelay property. AutomaticDelay屬性會 AutoPopDelay ReshowDelay 根據單一時間值,將、和 InitialDelay 屬性設定為初始值。The AutomaticDelay property sets the AutoPopDelay, ReshowDelay, and InitialDelay properties to initial values based on a single time value. 每次 AutomaticDelay 設定屬性時,屬性 ReshowDelay 值的屬性都會設定為 1/5 AutomaticDelayEvery time the AutomaticDelay property is set, the ReshowDelay property is set to 1/5 of the AutomaticDelay property value. AutomaticDelay設定屬性之後,您可以獨立設定 ReshowDelay 屬性,覆寫預設值。Once the AutomaticDelay property is set, you can independently set the ReshowDelay property, overriding the default value.

適用於

另請參閱