Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show/hide tool tips programatically

Status
Not open for further replies.

sammye

Programmer
Oct 5, 2007
35
0
0
US
Is there a way to show/hide all of the tooltips on a form programatically? I want to use them as sort of a help function by creating a button that toggles their view. I have found ways to show individual tooltips momentarily or allow the hover to work even if the form is not the focused form (ShowAlways), but nothing that just causes them to all be statically visible. Thanks in advance for any tips.
 
Tooltip control has a property called "Active" that can be set to true/false with a toggle button, checkbox or something like that.

Zameer Abdulla
 
That only allows the hover to work or not. If false, no tooltip is shown whenever hovering over whatever has a tooltip (even tried it to make sure). Thanks though, any other suggestions?
 
you could try using a StatusStrip. if you need more than that you could build your own contextual help.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Let some labels act as tool tip that can be show/hide using tag property.
Code:
		if (this.CheckBox1.Checked)
		{
			foreach (Control CTL in this.Controls)
			{
				if (CTL is Label)
				{
					if (CTL.Tag == "T")
					{
						CTL.Visible = true;
					}
				}
			}
		}
		else
		{
			foreach (Control CTL in this.Controls)
			{
				if (CTL is Label)
				{
					if (CTL.Tag == "T")
					{
						CTL.Visible = false;
					}
				}
			}

		}

Zameer Abdulla
 
Unfortunately I have been trying to avoid just that. The nice thing about a programatically controllable (fictional) tooltip is that it can act normally as a tooltip, but also as a help function when necessary. Thanks though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top