Open In App

How to set the initial delay of the ToolTip in C#?

In Windows Forms, the ToolTip represents a tiny pop-up box which appears when you place your pointer or cursor on the control and the purpose of this control is it provides a brief description about the control present in the windows form. In ToolTip, you are allowed to set the time passes before the ToolTip box pop-up by using InitialDelay Property.
With the help of this property, you can increase or decrease the time taken by the ToolTip box before it appears on the control. The maximum limit of this property is 32767. You can set this property in two different ways:

1. Design-Time: It is the easiest way to set the value of the InitialDelay property as shown in the following steps:



2. Run-Time: It is a little bit trickier than the above method. In this method, you can set the InitialDelay property of ToolTip programmatically with the help of given syntax:



public int InitialDelay { get; set; }

Here, the value of this property is of System.Int32 type and the period of the time is always in milliseconds.

Note: Always set the value of InitialDelay property small because if you set the larger value, then it will take more time to display on the screen. Due to large delay time the user does not enjoy the benefit of the ToolTip window.
The following steps show how to set the InitialDelay property of the ToolTip dynamically:


Article Tags :
C#