tooltips and user controls

  • Thread starter Thread starter Lance Johnson
  • Start date Start date
L

Lance Johnson

I have created a user control that's purpose is to to basically encapsulate
some other control. Is there any kind of way to make the tooltip work on
the control my user control contains? i.e. is there some message occurring
that I can pass onto my control or anything like that? Or any
properties/methods I can override or do something with?

Lance Johnson
 
Admittedly I'm no expert on ToolTips and haven't tried this exact situation,
but my inclination would be to add a public method to your User control,
"GetChild()" or something, that returns the control contained in the user
control. Then, in whatever part of the app where you're assigning your
tooltips, you can say:

Control C = myUserControl.GetChild(..maybe you need parameters here if you
have more than one contained control...);
myToolTip.SetToolTip(C, "here's a helpful message!");
 
I was hoping for more of an automated solution than this. Given that this
is the best solution given so far, I can just add a tooltip to my user
control and then make the user control have a tooltip property which
basically does the same thing.

Lance Johnson
 
Yeah I don't particularly like the way tooltips work either. I don't
understand why they're implemented as a separate control, rather than being
a part of the base visual control class so that your tooltip text could just
be another property. Maybe they'll fix that in some future incarnation of
the framework...
 
Back
Top