Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Message Box Decision
Message
De
16/11/2004 07:17:35
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00961641
Message ID:
00961650
Vues:
7
This message has been marked as a message which has helped to the initial question of the thread.
Neil

I found long ago that using Messagebox to ellicit a yes/no response happens so often that I made a function to handle it. I include it below for you if you wish. I call it sysCONFIRM. It's called like the following.
If sysConfirm("Are you sure you wish to quit this process", "Confirm Quit").  
You don't need to worry about the return numeric values of Messagebox. Even if you miss out the the message and caption params it will default to "Are you sure?"


HTH

Terry
LPARAMETERS	tcMessage, tcCaption
LOCAL		lcmessage, lcCaption, llYesNo

If EMPTY( tcMessage)
	lcMessage = "Are you sure?"
Else
	lcMessage = tcMessage
EndIf EMPTY( tcMessage)

If EMPTY( tcCaption)
	lcCaption = "Confirm"
Else
	lcCaption = tcCaption
EndIf EMPTY( tcCaption)

llYesNo = IIF( MESSAGEBOX( lcMessage, 36, lcCaption) = 6, .T., .F.)

Return llYesNo
>I have a message box with Yes and No buttons to delete a record in a grid.
>
>
>MESSAGEBOX("Are you sure you want to delete this contact?",4,'Delete contact')
>
>
>I would like to delete the record if yes. How do I test whether yes or no has been pressed on the message box?
>
>Many Thanks
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform