chosenOne Thabs
chosenOne Thabs

Reputation: 1640

Increase Asp.net tooltip timeout

Does anybody know how to increase the tooptip timeout on Asp.Net controls ? I tried to search for this on the net, but a lot of guys they recommend creating your own customized tool tip. But i don't want to do that i, want to use an existing one that comes with Asp.Net/VS. Is there a way to hack this ? Maybe in the web.config or something ? Thanks.

Upvotes: 2

Views: 2519

Answers (3)

Fandango68
Fandango68

Reputation: 4868

I know this has been answered, but in my opinion not very well.

It depends.

For Windows Forms I suggest a simple approach via the Form_Load method ...

http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.autopopdelay%28v=vs.85%29.aspx

For Web Forms, there CSS and it worked for me (see version 2) ...

http://www.cssplay.co.uk/menu/tooltips

Way easier than Java and simpler to implement, but of course it affects all controls and all their tooltips. Also, it's not timed, which is even better! Microsoft should not assume how long people take to read!

Upvotes: 0

Varun
Varun

Reputation: 373

I don't know what kind of controls u have target but you can achieve this functionality like this

class testToolTip
        {
            public string P1
            {
                get;
                set;
            }
            public string p2
            {
                get;
                set;  
            }
        }
        ToolTip toolTip = new ToolTip();    
        public Form1()
        {
            InitializeComponent();
            List<testToolTip> lstToolTip = new List<testToolTip>();
            for (int i = 0; i < 100; i++)
            {
                testToolTip  t =    new testToolTip()  ;  
                t.P1 =   "Prop " + i.ToString();  
                t.p2  =  "Prop 1" + i.ToString();
                lstToolTip.Add(t);                
            }
            dataGridView1.DataSource = lstToolTip;
            toolTip.IsBalloon = true;
            toolTip.UseAnimation = true;
            toolTip.UseFading = true;   

        }

        private void dataGridView1_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
        {

            Rectangle rect = this.dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);

            toolTip.Show(dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString(), this, rect.Location.X, rect.Location.Y,1000);


        }

Upvotes: 1

Tawnos
Tawnos

Reputation: 1887

The tooltip creates a title attribute on the object, which is client-controlled for timeout. You can't change how long it displays without creating some other type of popup for tooltips, e.g. by using javascript.

Upvotes: 2

Related Questions