• help tips when mouse over text box (2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » help tips when mouse over text box (2002)

    Author
    Topic
    #394303

    How do I make the help tips appear when I position the cursor over a textbox , or any other control?

    Code? or can I do it directly in the properties manager of the textbox? How?

    Thank you

    Viewing 0 reply threads
    Author
    Replies
    • #721609

      What kind of text box are you working with? From the Drawing toolbar, or from the Control Toolbox toolbar? If the latter, does the text box live on a worksheet, or on a userform?

      • #721614

        The textbox is from a Control Toolbox, and lives on a spreadsheet (with several others, in a crowded box in the background from the drawing menu)

        • #721622

          A text box on a worksheet doesn’t have a ControlTipText property. I hope that one of the Excel experts knows whether it is possible to show a tip text, and if so, how.

          • #721630

            I am by know means an expert, I do NOT think there is a DIRECT way to do this.

            The only way I know to do this (using the adage, if you don’t know an easy way, do it the difficult way) is to add a label on where you want the “tooltip” to be. Add text and format (size, color, etc) as desired

            Then in the “mousemove” event of the texbox add this code

            Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer,  _
                ByVal X As Single, ByVal Y As Single)
                
                Dim sSens As Single
                Dim sXLo As Single
                Dim sXHigh As Single
                Dim sYLo As Single
                Dim sYHigh As Single
                Dim oTip As Object
                Dim obj As Object
                
                
                sSens = 0.1
                Set oTip = Label1
                Set obj = TextBox1
                
                sXLo = obj.Width * sSens
                sYLo = obj.Height * sSens
                
                sXHigh = obj.Width * (1 - sSens)
                sYHigh = obj.Height * (1 - sSens)
            
                If X > sXLo And X  sYLo And Y < sYHigh Then
                    oTip.Visible = True
                Else
                    oTip.Visible = False
                End If
            End Sub

            It will unhide when the mouse is in the “center area” of the textbox and hide it when it gets near the border. The width of the change is determined by the “sensitivity” (sSens) which is set at 10% of the width/height. if too small you might not rehide the tip if you move over the textbox really fast.

            Change the objects as appropriate.
            Steve

            • #721640

              If you aren’t an Excel expert, who is? Thanks for confirming what I thought; I would have suggested MouseMove too, but I didn’t have time to try. Thanks for providing a complete example.

            • #721652

              I am just a chemist, who plays with excel. There is a lot I use (and am fairly knowledgeable in), there are items I know about, and have to think about them, and there are things I have never seen but I have heard about, and there are things I have never seen and am not sure they exist.

              There are the occasional example of these “can they be done” items, that I knew of no direct way, and have done a workaround and then someone gives an easier way. Look at post 295925 and my algebraic solution to an existing “built-in” function. (at least my algebra was correct).

              Maybe a “real excel expert” will tell us how to do it easily!

              Steve

            • #721716

              I will try your advice.

              In the mean time, I wrote a short piece of code that did the trick:

              Private Sub x_spacing_GotFocus()

              Dim message As String
              message = “If transpose direction is 1:” & vbCrLf
              message = message & vbTab & “X spacing will set the control point spacing WITHIN the new ribs” & vbCrLf
              message = message & vbTab & “Y spacing will define the distance among ribs” & vbCrLf
              MsgBox message

              End Sub

              Its primitive, doesnt have the font formatting, and it is very annoying if you have to correct the values you typed in the textbox very often (the msgbox will pop up every time you select the textbox)… but it did the job too!

              I have a high school degree in chemistry… does that help?

            • #721717

              I will try your advice.

              In the mean time, I wrote a short piece of code that did the trick:

              Private Sub x_spacing_GotFocus()

              Dim message As String
              message = “If transpose direction is 1:” & vbCrLf
              message = message & vbTab & “X spacing will set the control point spacing WITHIN the new ribs” & vbCrLf
              message = message & vbTab & “Y spacing will define the distance among ribs” & vbCrLf
              MsgBox message

              End Sub

              Its primitive, doesnt have the font formatting, and it is very annoying if you have to correct the values you typed in the textbox very often (the msgbox will pop up every time you select the textbox)… but it did the job too!

              I have a high school degree in chemistry… does that help?

            • #721653

              I am just a chemist, who plays with excel. There is a lot I use (and am fairly knowledgeable in), there are items I know about, and have to think about them, and there are things I have never seen but I have heard about, and there are things I have never seen and am not sure they exist.

              There are the occasional example of these “can they be done” items, that I knew of no direct way, and have done a workaround and then someone gives an easier way. Look at post 295925 and my algebraic solution to an existing “built-in” function. (at least my algebra was correct).

              Maybe a “real excel expert” will tell us how to do it easily!

              Steve

            • #721641

              If you aren’t an Excel expert, who is? Thanks for confirming what I thought; I would have suggested MouseMove too, but I didn’t have time to try. Thanks for providing a complete example.

          • #721631

            I am by know means an expert, I do NOT think there is a DIRECT way to do this.

            The only way I know to do this (using the adage, if you don’t know an easy way, do it the difficult way) is to add a label on where you want the “tooltip” to be. Add text and format (size, color, etc) as desired

            Then in the “mousemove” event of the texbox add this code

            Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer,  _
                ByVal X As Single, ByVal Y As Single)
                
                Dim sSens As Single
                Dim sXLo As Single
                Dim sXHigh As Single
                Dim sYLo As Single
                Dim sYHigh As Single
                Dim oTip As Object
                Dim obj As Object
                
                
                sSens = 0.1
                Set oTip = Label1
                Set obj = TextBox1
                
                sXLo = obj.Width * sSens
                sYLo = obj.Height * sSens
                
                sXHigh = obj.Width * (1 - sSens)
                sYHigh = obj.Height * (1 - sSens)
            
                If X > sXLo And X  sYLo And Y < sYHigh Then
                    oTip.Visible = True
                Else
                    oTip.Visible = False
                End If
            End Sub

            It will unhide when the mouse is in the “center area” of the textbox and hide it when it gets near the border. The width of the change is determined by the “sensitivity” (sSens) which is set at 10% of the width/height. if too small you might not rehide the tip if you move over the textbox really fast.

            Change the objects as appropriate.
            Steve

        • #721623

          A text box on a worksheet doesn’t have a ControlTipText property. I hope that one of the Excel experts knows whether it is possible to show a tip text, and if so, how.

      • #721615

        The textbox is from a Control Toolbox, and lives on a spreadsheet (with several others, in a crowded box in the background from the drawing menu)

    Viewing 0 reply threads
    Reply To: help tips when mouse over text box (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: