I have an owner-drawn UserControl that I'm making, and I don't see a ToolTipText property? :confused:
How would I go about adding one without adding a control on there like a label or whatever. :mad:
Printable View
I have an owner-drawn UserControl that I'm making, and I don't see a ToolTipText property? :confused:
How would I go about adding one without adding a control on there like a label or whatever. :mad:
Tooltip property will "appear" when you add UserControl to any form.
However, if UserControl contains any child control (label, textbox, etc) then you may assign individual ToolTips for those controls.
So, at run time your user control may have multiple tooltips - one general and one for each child control.
As RhinoBull pointed out, the tooltip is assigned not by the usercontrol (uc). When a user adds your uc to their form/container, then the user can assign a tooltip. Think of your uc in terms of other VB controls, those controls do not assign tooltips, rather the user does when they add the control to the project.
Though you can create your own api tooltip, it may be confusing to the user if they also assigned a tooltip. There are hacks around this, but again, wouldn't recommend it.
Oh man how did I miss that? :blush:
I added it to my form and still didn't see a ToolTipText property but now I see it.
Thanks. :o
Hi guys,
I am trying to get the tooltiptext property as well...
After read the posts, I still cannot get that property..
What I am trying to do is showing a tooltip when a mousehover a label.
I tried with SetToolTip ( not tooltiptext because i couldn't find it ) but nothing is shown when I hover the label. What have I done wrong?
I know this is an old topic, but I was also searching the forums and could not find an answer on how to get the ToolTipText of the UserControl (as a designer of the UserControl).
The following don't work, UserControl.ToolTipText or Me.ToolTipText.
But if you need to access the ToolTipText on runtime, so what the user of the control set during designtime or on runtime, you can access the ToolTipText using UserControl.Extender.ToolTipText
The ToolTipText (for a user control, UC) is one of the Extender Properties that you always get when you use this UC on a form. As such, it's not really meant to be used within the UC's code itself. If you did, you wouldn't know which instance of the UC's ToolTipText property you were talking about.
So, if you have a UC on your form named "MyUc", you'd get to the ToolTipText property by: Debug.Print MyUc.ToolTipText
As we see, we just use the actual name of the control as it appears on our form. From within the form's code (but not the UC's code), we've got direct access to all of these ToolTipText properties for all the controls on the form.
What are you talking about? When developing a UserControl and I read the UserControl.Extender.ToolTipText from within the usercontrol, like the event UserControl_MouseMove() , I get the ToolTipText of that specific instance which is placed on the form. Even if I have a 100 of my UserControls on the same form, or even in a control array, UserControl.Extender.ToolTipText gives me the ToolTipText of that one instance and not random of any of the other instances places on a form.
Really? I would not have guessed that.......:ehh:
Have you ever created your own usercontrol? If so, you would know that it is very handy to know what the user of your control has entered in certain properties from within your usercontrol, it's even basic needs, as without knowing the value of properties within your usercontrol, you can't really do anything. And in this case, I need to know from within my usercontrol what the user has entered as ToolTipText, and I want to know WHEN the user changes the value so I can do stuff with it. That's how you create a UserControl.