Results 1 to 8 of 8
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MouseMove Event (97 SR2)

    I've got the following code attached to a textbox on a userform:

    Private Sub tbfirst_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If tbFirst.Value = Null Then Exit Sub
    tbFirst.ControlTipText = tbFirst.Value
    End Sub

    The purpose is to make all of the text visible, even if the text extends beyond the size of the text box.

    When I attempt to run this code, i'm getting the following error:

    Compile Error:

    Event procedure declaration does not match description of event having the same name.

    This makes about as much sense to me as greek.. any idea why this code isn't working?

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MouseMove Event (97 SR2)

    Put ByVal in front of all the parameters, and Bob's your uncle.

    ie Private Sub tbfirst_MouseMove(byVal Button As Integer, byVal Shift As Integer, byVal X As Single, byVal Y As Single)

    Jon

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MouseMove Event (97 SR2)

    I'll be darned! I guess Bob is my uncle! <img src=/S/joy.gif border=0 alt=joy width=23 height=23>

    Thanks Jon!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MouseMove Event (97 SR2)

    Okay, now that we've got that worked out.. (Immense thanks!) can you think of a way to make it conditional? I.E. the ControlTipText property only changes if the text in the textbox is over the width? <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MouseMove Event (97 SR2)

    Bob's actually my wife's uncle.

    Without wishing to be seen to be teaching you how to suck eggs, the help text on that event had ByVals in it (for once I actually read the instructions).

    Jon

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MouseMove Event (97 SR2)

    Doh!
    Attached Images Attached Images
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  7. #7
    Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MouseMove Event (97 SR2)

    Unfortunately not off the top of my head, and the kids have just got up. I'll have a think about it, and some bright spark might know the answer in the meantime anyway.

    Jon

  8. #8
    Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MouseMove Event (97 SR2)

    Having had a look at this, I think you're going to have to go with an API call (though I have no idea which one).

    You seem to be trying to work out the length of the text in the text box in points, which will depend on the font used and the characters in the text box.

    You could do it roughly by working out the number of 0's that will fit in the text box, and checking whether TextLength is greater than that number. Apart from that, I'm afraid I have no better suggestions.

    Jon

Posting Permissions

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