Click here to Skip to main content
11,803,019 members (74,209 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# User-controls UI

I would like to create a button (with an image on it) in c# User Control. When a user hovers with the mouse over the button, and stays there for a second, I would like a small message\dialog\something like this to pop up and describe in 2 words what the button is. (For example, it will write "edit" for an Edit Text button).

When the user moves the mouse from this button, I want this message to disappear.

How can I do it?

Posted 22-Oct-12 3:19am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I think this would be the perfect solution for you:

private void ButtonName_MouseHover(object sender, EventArgs e)
            System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
            ToolTip1.SetToolTip(this.button1, this.button1.Text);

Hope it helps... \m/
ridoy at 22-Oct-12 12:51pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

1. Add image to BackgroundImage property of button.

2. Add a tooltip to the button.
3. Find the property 'ToolTip on toolTip1' (the name may not be toolTip1 if you changed it's default name).Now write "Edit"(as according to your requirement or anything you write will be popped out) on the tooltip property of button.

Now if you want this manually use this as under-.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication29
    public partial class Form1 : Form
        public Form1()
        ToolTip t1 = new ToolTip();
        private void button1_MouseHover(object sender, EventArgs e)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use TOOL TIP Property of the button.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 335
1 KrunalRohit 291
2 F-ES Sitecore 270
3 CPallini 270
4 Sergey Alexandrovich Kryukov 234
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,735
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 22 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100