Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Houston, Tx, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help tips when mouse over text box (2002)

    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
    Guillermo

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: help tips when mouse over text box (2002)

    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?

  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Houston, Tx, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: help tips when mouse over text box (2002)

    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)
    Guillermo

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: help tips when mouse over text box (2002)

    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.

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: help tips when mouse over text box (2002)

    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

    <pre>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 < sXHigh And Y > sYLo And Y < sYHigh Then
    oTip.Visible = True
    Else
    oTip.Visible = False
    End If
    End Sub</pre>


    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

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: help tips when mouse over text box (2002)

    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.

  7. #7
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: help tips when mouse over text box (2002)

    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>post 295925</post#> 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

  8. #8
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Houston, Tx, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: help tips when mouse over text box (2002)

    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?
    Guillermo

Posting Permissions

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