Open In App

How to set icon in 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 an icon in the ToolTip window with ToolTip text using ToolTipIcon Property. This property accepts four different types of values that are defined under ToolTipIcon enum and the values are:

You can set this property in two different ways:



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

public System.Windows.Forms.ToolTipIcon ToolTipIcon { get; set; }

Here, ToolTipIcon represents a value provided by the ToolTipIcon enum. The following steps show how to set the ToolTipIcon property of the ToolTip dynamically:


Article Tags :
C#