Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to don't need set Messagebox Title Text many times ?
Message
 
To
19/02/2001 03:17:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00477212
Message ID:
00477502
Views:
21
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform