Tab Control tooltip

Hey I am using Visual C# 2005,

How do you make it so that if you put your mouse over a tab on a tab control then it will show a tooltip like this:

Title of site
URL of site

So a 2 lined tooltip?

Thanks :)

[254 byte] By [progames25] at [2007-12-23]
# 1

Hi progames25,

First set the tabcontrol.ShowToolTips to true.

Second set the tabpage1.ToolTipText = Title_of_Site + "\n" + URL_of_Site.

Works fine here.

gqlu at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2

Ok I set it to true...but is there another way to do the tab page thing?

because if it is another tab page other then the first tabpage..then it wont show it...and it is a user create tab control...my way of saying the users add the tab pages...

Thanks :)

progames25 at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3
After the tooltiptext of tabpage1 and tabpage2 are set, the tooltips are shown correctly. Say, move the cursor over the tab1 and tab2, it's ok. I use the standard tabcontrol here. Since yours is a custom control, maybe it has its own way of doing such things.
gqlu at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 4
Well, it is the Tab Control that is default in Visual C# but I amde it so that if you press a Toolstrip button then it will add a tab to the control with a Webbrowser control in it... But even if I have it for just the first tab it still does not show the tooltip...I checked if tooltips was set to true and it is...
progames25 at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 5

Strange.

I make a new project and add a button and a tabcontrol. I don't see anything wrong with the code below.



private void button1_Click(object sender, EventArgs e)
{
tabControl1.ShowToolTips = true;
tabPage1.ToolTipText = "Tab 1";
tabPage2.ToolTipText = "Tab 2";
TabPage tp = new TabPage("Added");
tp.ToolTipText = "Tab 3";
tabControl1.Controls.Add(tp);
}

gqlu at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 6

Still, it does not show the tooltip when my mouse is over the tab...

this is what I have for tabpage 1:

this.tabControl1.ShowToolTips = true;

tabPage1.ToolTipText = (thiswebpage.Document.Title + thiswebpage.Document.Url.ToString());

progames25 at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 7
It should be a simple problem. But it seems that it's weird...
gqlu at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 8
I just put my mouse cursor over the tab and nothing happens I dont move it at all...
progames25 at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...