Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# User-controls UI
Hello,
 
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?
 
Thanks
Posted 22-Oct-12 4:19am
Rate this: bad
good
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/
  Permalink  
Comments
ridoy at 22-Oct-12 12:51pm
   
+5
Rate this: bad
good
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()
        {
            InitializeComponent();
        }
        ToolTip t1 = new ToolTip();
        private void button1_MouseHover(object sender, EventArgs e)
        {
            t1.Show("Edit",button1);
        }
    }
}
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use TOOL TIP Property of the button.
  Permalink  

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

  Print Answers RSS
0 Mathew Soji 334
1 Maciej Los 295
2 BillWoodruff 290
3 Afzaal Ahmad Zeeshan 257
4 DamithSL 205
0 OriginalGriff 6,369
1 Sergey Alexandrovich Kryukov 5,973
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,045


Advertise | Privacy | Mobile
Web02 | 2.8.1411019.1 | Last Updated 22 Oct 2012
Copyright © CodeProject, 1999-2014
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