Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent User From Leaving Form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00383396
Message ID:
00383420
Vues:
29
>>How can I prevent a user from clicking on another form unless they have completed a specific task [under 1 specific condition] on the currently active form. I can not make the currently active form modal because most of the time [90%], the user can jump to other forms.
>>
>>I have tried stuff in the deactivate and lostfocus, but nothing works very cleanly.
>>
>>TIA!
>
>Hi Mark,
>
>How about making the form Modal?

Nope. Can't do that. Re-read my entire problem. Actually I have found a clever solution. When the condition exists where I have to simulate a modal form, I change the form's AlwaysOnTop property to true. The problem was the Deactivate was firing twice -- once when the user clicks on another form and once because of the messagebox. In the Deactivate, I put:
if This.lAddMode
	if empty(This.Tag)
		This.Tag = "NOMSG"
		MessageBox('You must first complete or cancel the addition of the new record.', MB_ICONEXCLAMATION, "Warning...")
		This.Show()
	else
		This.Show()
		This.Tag = ""
	endif
else
	DoDefault()
endif
This is kind of a kludge, so I am open for more elegant options.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform