Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple textbox quest
Message
 
À
20/05/2003 07:29:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00787326
Message ID:
00792173
Vues:
28
Glenn, in your #1 below (testing the object name for a character value, we are sure it is an object), what else could it be besides 'C', perhaps 'N' numeric. Would this have been a monkey wrench?


>Sorry about the delay in responding to your question, I have been very busy and have not spent any time on the UT lately.
>
>How it works:
>

    >
  1. First make sure an object on the form currently has focus. By testing the object name for a character value, we are sure it is an object plus the object is still "alive".
    >
  2. We then use "Pemstatus" to test if this object has a "VALUE" property defined.
    >
  3. Then we store the current value to the control source of the object by forcing it's value programatically. Normally this would happen when the control loses focus, but because the "LOSTFOCUS" event will not necessarily take place we force the value upon itself. The same consequence will occur if we:
    thisform.activecontrol.setfocus()
    >
  4. The Dodefault() is there in case you have any upstream processing which is defined in a parent class, otherwise it is not necessary.
    >

>
>Glenn
>
>>Glenn, that worked perfect. Can you briefly explain how it works and about the pemstatus? Is the dodefault() critical?
>>
>>>You could do the following in the "save" method
>>>
>>>
>>>Form::Save
>>>if type('thisform.activecontrol.name') = 'C' and ;
>>>  pemstatus(thisform.activecontrol,'value',5)
>>>    thisform.activecontrol.value = thisform.activecontrol.value
>>>endif
>>>dodefault()
>>>
>>>
>>>>On a form I have with a slew of textboxes, normal proceedure is for a user to make his/her changes and hit F1 to save. If a user makes a change to a textbox's data, they have to hit ENTER(or a textbox lost.focus must occur) for the data to be saved. In other words, if they make a change and don't hit ENTER, then hit F1, the data is not saved. Is there a way to eliminate the need for ENTER after changing a txtbox value?
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform