Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MouseLeave() method on listbox doesn't always run.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00775793
Message ID:
00776198
Vues:
21
Neat idea, but still end up with the same problem, my mouse speed is simply too fast. In the OS I have my mouse speed set to the max, so if I move my mouse like 1/2 inch it flys clear across the screen.

>Hi Victor,
>
>I've had better luck placing the listbox ontop of a shape that sits on the form just inside the form's boundaries. For some reason moving the mouse off of the listbox and passing over the shape causes the mouseleave event of the listbox to fire regardless of the mouse speed.
>
>I should note that I am doing this in VFP8 so I have not tried it in VFP6 or VFP7.
>
>Here's a small example that seems to work for me:
>
>loform=CREATEOBJECT('mouseleaveexample')
>loform.show
>READ EVENTS
>loform=.null.
>RELEASE loform
>
>
>DEFINE CLASS mouseleaveexample AS form
>
>	Top = 0
>	Left = 4
>	Height = 250
>	Width = 391
>	DoCreate = .T.
>	Caption = "MouseLeave Example"
>	Name = "MyForm"
>
>	ADD OBJECT shape1 AS shape WITH ;
>		Top = -2, ;
>		Left = -3, ;
>		Height = 264, ;
>		Width = 399, ;
>		Name = "Shape1"
>
>
>	ADD OBJECT list1 AS listbox WITH ;
>		RowSourceType = 5, ;
>		RowSource = "myarray", ;
>		Height = 235, ;
>		Left = 10, ;
>		Top = 6, ;
>		Width = 372, ;
>		Name = "List1"
>
>
>	PROCEDURE Load
>		DIMENSION myarray(50)
>		ln=0
>		FOR i = 1 TO 50
>		   ln=ln+1
>		   myarray(ln)=ALLTRIM(STR(ln))
>		ENDFOR
>		DODEFAULT()
>	ENDPROC
>	
>	PROCEDURE UnLoad
>		CLEAR EVENTS
>		DODEFAULT()
>	ENDPROC
>
>	PROCEDURE list1.MouseLeave
>		LPARAMETERS nButton, nShift, nXCoord, nYCoord
>		WAIT WINDOW "Left form at "+ALLTRIM(STR(SECONDS()));
>                  NOCLEAR NOWAIT TIMEOUT 3
>	ENDPROC
>
>
>ENDDEFINE
>
>
>
>>I have a listbox that covers an entire form. (Don't ask - there is a good reason)
>>
>>Anyway my problem is that when the person moves the mouse off the listbox (and thus the form) I want some code to run....sooooo I put it in the MouseLeave() method of the listbox. My problem is that unless the user is moving the mouse reeeeeeallly reaaaaaaly slow - the event doesnt run.
>>Any suggestions on a fix for this??
>>
>>Thanks!
ICQ 10556 (ya), 254117
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform