You can always grab the ToolTip control out of the toolbox, but I prefer to add a common function to a base form so I don't have to remember to add this control to the form. Then, any time I want to add a tooltip, I pass in the control and the text, and this simple snippet will take care of it for me. I remembered it as I needed to add some tooltips, which is something the existing application lacks.
protected void SetToolTip(IContainer component, Control ctrl, string tip)
{
try
ToolTip tooltip = new ToolTip(component);
tooltip.SetToolTip(ctrl, tip);
tooltip.Active = true;
}
catch
//Don't worry
Usage:
41 SetToolTip(this.components, lvwCategories, "Right click for menu options...");
Powered by: newtelligence dasBlog 2.3.9074.18820
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, © Copyright 2010
E-mail