I have a form with controls and associated tooltips. I'm implementing a help-button witch should show all the tooltips at once.
I would like to implement it somehow like this:
private void btnHelp_Click(object sender, EventArgs e)
{
System.Windows.Forms.Control.All.Show.Their.Tooltips();
}
Can't find a simple way to do it :-)
I was thinking of using ToolTip.Show() but it requires not only the control, but also the tooltip text - but I don't want to write it again (since necessary tooltips are already assigned in controls' properties).
UPD. I started implementing it with this function:
public void ShowControlsTooltip(System.Windows.Forms.Control c)
{
ttsToolTips.Show(ttsToolTips.GetToolTip(c), c, c.Location.X, c.Location.Y);
}
But I can't make it show multiple tooltips at the same time.
UPD2. Now I have this kind of code, but all tooltips still blink and disappear.
public void ShowControlsTooltip(System.Windows.Forms.Control c)
{
ToolTip t = new ToolTip();
//t = ttsToolTips;
t.Show(ttsToolTips.GetToolTip(c), c, c.Location.X, c.Location.Y, 1000);
}
private void btnHelp_Click(object sender, EventArgs e)
{
foreach (Control c in this.Controls)
{
try
{
ShowControlsTooltip(c);
}
catch
{
}
}
}
The thing with ttsToolTips is that I have all the tooltips associations there already.
UPD3. it looks like works. But coordinates are not exact.
The big question is now - how to remove all these tooltips at once?