Sunday, 1 May 2011

Button ToolTip in Win Forms:-


Button ToolTip in Win Forms:-



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 WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ToolTip toolTip1 = new ToolTip();
            toolTip1.ShowAlways = true;
            toolTip1.SetToolTip(button1, "Click me");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            ToolTip btnToolTip = new ToolTip();

            btnToolTip.ToolTipTitle = "Button Tooltip";
            btnToolTip.UseFading = true;
            btnToolTip.UseAnimation = true;
            btnToolTip.IsBalloon = true;

            btnToolTip.ShowAlways = true;

            btnToolTip.AutoPopDelay = 5000;
            btnToolTip.InitialDelay = 1000;
            btnToolTip.ReshowDelay = 500;

            btnToolTip.SetToolTip(button2, "Click me");
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}

No comments:

Post a Comment