Results 1 to 12 of 12

Thread: [RESOLVED] Dynamically adding tool-tips to controls

Threaded View

  1. #1

    Thread Starter
    Addicted Member Reapism's Avatar
    Join Date
    Sep 2012
    Posts
    170

    Resolved [RESOLVED] Dynamically adding tool-tips to controls

    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.

    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
    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.

    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.
    Last edited by Reapism; Mar 29th, 2016 at 08:38 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width