C#: Añadir ToolTip Text a un botón / Set ToolTip for a Button


Instanciamos un objeto ToolTip y, dentro de un evento MouseHover, establecemos el texto que queremos que aparezca al pasar por arriba del botón:

System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();

public frmABMC() 
{
    InitializeComponent();
    this.btnCerrar.MouseHover += new EventHandler(btnCerrar_MouseHover);
}

void btnCerrar_MouseHover(object sender, EventArgs e)
{
    ToolTip1.SetToolTip(this.btnCerrar, "Cerrar");
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s