Objective: I want to specify a control in a form to display a tooltip dynamically to that object when the mouse is hovered. I tried to fool around a little bit and I have this... I am probably not close to what I need to achieve but I gave it a shot.
I know one fundamental problem, Me.MouseHover only works on the form itself and not the controls of that form.
The issue is that when I hover over a control in the form, it doesn't generate the tooltip. How do I get this code to do what it should do? It seems to look write but when it runs, and you hover over a control, it doesn't actually create a tooltip.Code:Public Sub determineControl() Handles Me.MouseHover Dim c As Control = Me For Each ctrl As Control In c.Controls If TypeOf ctrl Is GroupBox Then Dim tip As New ToolTip tip.SetToolTip(ctrl, ctrl.Tag) End If Next End Sub
Also I will create the tooltip on load and just change its properties based on the control its on.
EDIT: I just had another read of what you've said. Do I change the handler to MouseMove?
HUGE EDIT: I am using a tab pages. I want it to loop through the groupboxes in the tab page!
I want it to loop through all the controls in the selected tab page.




Reply With Quote
