VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mouse move event

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
278 Views, 3 Replies

Mouse move event

Hello to all i'm try to change the icon of my image control.
In the MouseMove event of the control i have set a path for icon, in the MouseMove event of my form if the control have a particular tag i change the icon.
This routine works good but if i click in the image the routine dont work fine. Why?

Routine:
'Image
If Me.ESDatiPrincipali.Tag = "Off" Then
Me.ESDatiPrincipali.Picture = LoadPicture("\\Sole\Dati\Icone\FrecciaSu_illuminata.ico")
Else
Me.ESDatiPrincipali.Picture = LoadPicture("\\Sole\Dati\Icone\FrecciaGiu_illuminata.ico")
End If

'Forms
If Me.ESDatiPrincipali.Tag = "Off" Then
Me.ESDatiPrincipali.Picture = LoadPicture("\\Sole\Dati\Icone\FrecciaSu.ico")
Else
Me.ESDatiPrincipali.Picture = LoadPicture("\\Sole\Dati\Icone\FrecciaGiu.ico")
End If

Thanks to all.
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

After clicking in the image control, setting its .Picture property no longer causes the WM_PAINT meassage to be sent to the userform. Must be a bug. You could send the message yourself (SendMessage API function), call the .RePaint method of the user form (will probably cause filckering), or set the .Visible property of the image control to False and back to True after setting the .Picture property(probably the way to go).
Message 3 of 4
Anonymous
in reply to: Anonymous

> (SendMessage API function)

Bad call on my part. RedrawWindow would be the one to use.
Message 4 of 4
Anonymous
in reply to: Anonymous

Thanks i tested it (Bad english sorry)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost