PDA

View Full Version : [SOLVED] MouseMove event for disabled controls.



Bhatti1981
03-26-2017, 10:42 PM
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

mikerickson
03-26-2017, 11:28 PM
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.

Bhatti1981
03-27-2017, 06:39 AM
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.

mdmackillop
03-27-2017, 10:23 AM
Star is below your flag.

Bhatti1981
03-28-2017, 06:07 AM
Star is below your flag.

Really sorry but there is no star bellow the flag.

mdmackillop
03-28-2017, 06:18 AM
You're correct. That's where I see it. Check below the poster's name

Bhatti1981
03-28-2017, 11:14 PM
snap on my machine

Aussiebear
03-29-2017, 01:47 AM
@Bhatti1981 Have done so on your behalf

Bhatti1981
03-30-2017, 07:13 AM
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.

Aussiebear
04-01-2017, 05:53 AM
Because the Star is visible other users not yourself.