Consulting

Results 1 to 10 of 10

Thread: MouseMove event for disabled controls.

  1. #1

    MouseMove event for disabled controls.

    Hello

    Any chance we may get help text for disabled userform controls through mousemove event.I tried in the ExcelHelpforum but could not get a solution.(Unable to post a link to that coz my post count here is bellow the required one.


    Any help would be greatly appreciated.

    Best Regards
    Imran Bhatti

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    I'm not sure what you want, but I made a MouseMove event for a TextBox and put some code in the Userform_MouseMove event to call that TextBox1_MouseMove event even if the TextBox.Enabled is False.

    Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
        Me.Caption = x & ":" & y
    End Sub
    
    Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
        With TextBox1
            If Not .Enabled Then
                If .Left < x And x < .Left + .Width Then
                    If .Top < y And y < .Top + .Height Then
                        Call TextBox1_MouseMove(Button, Shift, x - .Left, y - .Top)
                    End If
                End If
            End If
        End With
    End Sub
    This assumes that the TextBox is directly in the Userform and not inside a Frame or Multi-page.

  3. #3
    Thanks mike

    I don't see any star to add reputation to you.Is here some thing like that?


    Any way help is much appreciated.

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Star is below your flag.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Quote Originally Posted by mdmackillop View Post
    Star is below your flag.
    Really sorry but there is no star bellow the flag.

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You're correct. That's where I see it. Check below the poster's name
    Attached Images Attached Images
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    snap on my machine
    Attached Images Attached Images

  8. #8
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,063
    Location
    @Bhatti1981 Have done so on your behalf
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  9. #9
    Thanks AussieBear.
    I wonder why the star is not showing on my window.I believe it is not something due to being newbie ,coz right to say thanks to Helping Experts/Gurus/Members should not be earned but be provided.

  10. #10
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,063
    Location
    Because the Star is visible other users not yourself.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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