Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to tell if clicked outside of form
Message
 
À
16/05/2003 13:29:30
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00789340
Message ID:
00789384
Vues:
26
This message has been marked as the solution to the initial question of the thread.
I believe that you can use /on key label mouse/ command here.
Something like this:

-call a form with a name, like
do form fakeform name HELLO

- to the fakeform.unload add :
on key label mouse

-in the fakeform.load event add:
on key label mouse fakeform.whereclicked

- add a method whereclicked to fakeform having code to get the object behind the mouse (sys(1270) and sys(1271) should help here) or x-y mouse coordinates (Amouseobj() should help here), and check whether it is clicked on the fakeform. If it is outside the form, call hello.release
For example,
lcobj=sys(1270)
if NOT "fakeform.scx"$lower(trans(sys(1271,lcobj)))
hello.release
endif

Hope this help


>Hello All,
>
>I have a VFP7 SP1 form that contains a listbox. I allow any item in the list to be edited by displaying a second form (lets call it 'fakeform') over top of the listitem to be modified. Fakeform is exactly the same size (height and width) of the listitem to be edited. It has no border or titlebar. It is modal and thus far it works fine with the keyboard. Hitting Enter or Escape closes fakeform.
>
>My problem is that I would like to have fakeform disappear when the user clicks outside of its boundary. IOW, it would have the same behavior as a dropdown list where if you click anywhere outside of the dropdownlist, the dropdownlist disappears.
>
>
>Your thoughts and suggestions are appreciated.
>
>TIA
>
>Mike.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform