I need to understand how to utilize a ToolTip
with a custom UserControl
. Just creating the ToolTip on a form and assigning the specific control a ToolTip (via SetToolTip
) obviously will not work.
What properties do I need to give the custom UserControl in order to assign ToolTip text to it? Do I need to add a ToolTip on the usercontrol form? How can I go about doing this?
Please provide a code sample or something for me to visualize.
Thank you!
Put a ToolTip on your UserControl (use the designer, just like you would put one on a form), and add a public property to your UserControl like:
public string TextBoxHint
{
get
{
return toolTip1.GetToolTip(textBox1);
}
set
{
toolTip1.SetToolTip(textBox1, value);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With