ToolTip.ReshowDelay Property

Definition

获取或设置指针从一个控件移到另一控件时,必须经过多长时间才会出现后面的工具提示窗口。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

Property Value

Int32

显示后续工具提示窗口所需要的时间(以毫秒为单位)。The length of time, in milliseconds, that it takes subsequent ToolTip windows to appear.

Examples

下面的代码示例创建 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. 然后,该代码将 AutoPopDelayInitialDelayReshowDelay初始化延迟属性。The 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. 最后,该示例将工具提示文本与窗体上的两个控件、ButtonCheckBox相关联。Finally, the example associates ToolTip text with two controls on a form, a Button and a CheckBox. 此代码示例要求在示例中定义的方法位于包含名为 button1Button 控件和名为 checkBox1,CheckBox 控件的 Form 中,并且该方法是从 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

Remarks

使用 "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 属性根据单个时间值将 AutoPopDelayReshowDelayInitialDelay 属性设置为初始值。The AutomaticDelay property sets the AutoPopDelay, ReshowDelay, and InitialDelay properties to initial values based on a single time value. 每次设置 AutomaticDelay 属性时,AutomaticDelay 属性值的 ReshowDelay 属性都将设置为1/5。Every 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.

Applies to

See also