Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Putting different text in a textbox in a form
Message
De
02/04/1999 05:12:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00203752
Message ID:
00204576
Vues:
17
>>>I've created a form for prompting different error messages. The form contains a Textbox for different error messages which I want to put for the user.
>>>
>>>How should I run the form and then put the Value of the Error Messages with my choice? Is it possible? For example err..
>>>
>>>errform.txtErrmsg.value = "Record not found."
>>Hi Gan,
>>Joseph and Kenneth already have good suggestions about using textbox and labels. I have another suggestion too :)
>>I would suggest using messagebox(). Because unlike additional forms, messagebox() doesn't cause the form's some events (ie: activate event) fire on return :) Reentrant firing events might be other invitation to errors in some cases (ie: lostfocus of activecontrol fires, your form kicks in, gotfocus of control fires on return, or valid event causes another error in between). To my experience, calling messagebox() is harmless compared to calling a new form :)
>>Cetin
>
>Cetin,
>
>This is a good thing to be know. I don't think it was an issue in VFP 3.0, but in our conversion to VFP 5.0 it has been a problem (workarounds required at times).
>
>Do you (or anyone else reading) know of a way to make a modal form act like a messagebox? In other words, avoid firing LostFocus, Activate, etc. in the calling form...
>
>Joe
Hi Joe,
I tried to make a modal form class acting like a messagebox to no avail. Messageboxes behave as if they are not part of VFP but the system itself. OTOH whatever I tried I couldn't avoid activate of calling form on return (w/o coding something on calling form). At first it wasn't a problem but I hit some situations where it shouldn't occur at all. Think of this :
You have a grid and table has record level validation. At a point you want to present a warning via a form (or a listbox to choose from). Ooops as grid loses focus VFP error mechanism kicks in and complains about "uniquness of index violation", "record level validation" etc. With messagebox there is no problem. As a workaround I fill the needed fields with dummy data and empty them on return or use table buffering vs row buffering. But all in all it beats the "messagebox" form class.
Yet there is another possibility to overcome only a minority of problems. Instead of a new form, new objects could be added and removed just on the calling form. Or mimic the messagebox and build a nonVFP form so it would be task switching vs form switching ? Currently I prefer using messagebox().
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform