Open In App

How to set automatic delay for 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 can set the automatic delay for the ToolTip using AutomaticDelay Property.
This property allows you to set a solo delay values for the AutoPopDelay, InitialDelay, and ReshowDelay properties. Whenever the value of AutomaticDelay property, then the following values set by default:

The values of these properties can also be set independently. You can set this property in two different ways:



1. Design-Time: It is the easiest way to set the value of the AutomaticDelay 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 AutomaticDelay property of ToolTip programmatically with the help of given syntax:

public int AutomaticDelay { get; set; }

Here, the value of this property is of System.Int32 type and the delay is always in milliseconds. The default value of this property is 500. The following steps show how to set the AutomaticDelay property of the ToolTip dynamically:


Article Tags :
C#