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

    MouseOver Userform Objects (97 SR2)

    Greetings,

    There doesn't appear to be a function for this, I'd like to execute code on the mouse-over of a specific control (preferrably a label), does anyone know of a method of doing this? <img src=/S/grin.gif border=0 alt=grin 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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: MouseOver Userform Objects (97 SR2)

    There is a MouseMove event for most controls. For a label named Label1 it would be :

    Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

    End Sub


    It may be enough to achieve what you want.

    Andrew

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

    Re: MouseOver Userform Objects (97 SR2)

    Thanks Andrew!

    This working well, sortof... Can you think of a way to differentiate between a mouse in and a mouse out? I'm trying to use this funtion to build a menu within a userform, but I can't think of way do properly display a series of hidden frames using just this trigger.

    Any help you can provide would be Great! <img src=/S/grin.gif border=0 alt=grin 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

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: MouseOver Userform Objects (97 SR2)

    Drk,

    Try two labels, one bigger thann the other and have it surround a smaller label which should be in front. You could then program the MouseMove event of each label so that you have a toggle.

    See a very crude example of the idea on the attached workbook.

    Andrew
    Attached Files Attached Files

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MouseOver Userform Objects (97 SR2)

    Good idea!
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

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

    Re: MouseOver Userform Objects (97 SR2)

    Nice! this is working very well.

    For those who try to develop this further, I'm using it to build a 'true type' menu system for my userform. The key here is to use only one control in place of label1 in the above example. You can lay it out across your userform and code it such that it hides all applicable objects.

    thanks Andrew, a brilliant option! <img src=/S/bow.gif border=0 alt=bow width=15 height=15>
    <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

Posting Permissions

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