Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to don't need set Messagebox Title Text many times ?
Message
 
À
19/02/2001 03:17:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00477212
Message ID:
00477502
Vues:
20
Kengwen
The simplest way is to set a variable to the title you want and simply add this variable each time you use a messagebox.

However if you don't want to type the variable in each time you can use a 'wrapper' - a function that calls the messagebox and passes the proper variable automatically. Then instead of calling Messagebox() you would call MyMessageBox(). You will also need an application variable (or global variable) with your title.

Suggested code:
function MyMessageBox()
lParameter cMessage, nDisplay, cTitle
if type('cTitle') <> 'C'   && No title passed
   cTitle = MyTitleVariable
endif

if type('nDisplay') <> 'N'
   nDisplay = 64    && Information, default OK button
endif

if type('cMessage') <> "C"
   cMessage = 'Forgot to pass a message parameter'
endif
nRet = messagebox(cMessage, nDisplay, cTitle)
return nRet
HTH
Barbara



>Hi,
> Is it posible to set the messagebox title text once time and don't need to set or type it in the coding everytime ?
> Did Visual FoxPro provide the project properties to set the application Title which will automatically be the messagebox Title text ?
>Thanks
>
>
>kengwen
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform