Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox VALID not firing?
Message
From
08/03/2000 05:02:04
Jill Derickson
Software Specialties
Saipan, CNMI
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00341975
Message ID:
00343167
Views:
33
Hi Nadya,

I remember there being some problem using the Default property set to .T. on a button....I'm not sure if that could be related to your problem or not...did you convince yourself that returning a .F. from a Valid will not let you out, even w/mouse actions? J

>Jill,
>
>I'm really messed up :( I have a class, which allows me to add values, if they are not duplicates. This is exactly what I have in textbox.valid method:
>
>
>********************************************************************
>*  Description.......: Text1.Valid
>*  Calling Samples...:
>*  Parameter List....:
>*  Created by........: Nadya Nosonovsky 03/07/2000 03:20:36 PM
>*  Modified by.......: Nadya Nosonovsky 03/07/2000 04:57:47 PM
>********************************************************************
>local lcValue
>lcValue=alltrim(this.value)
>with this.parent.parent
>     .AllowAdd=.f.
>     .Validate(lcValue)
>   if .AllowAdd
>     .AddValue(lcValue)
>     this.parent.list1.Requery()
>     this.value=''
>   endif
>endwith
>return this.parent.parent.AllowAdd
>
>
>The problem is that I have Ok button on the form with Default property set to .T.
>So, each time, I hit Enter, this form finishes it's work. I tried NoDefault in KeyPress, but now it doesn't work the way I want.
>
>>That is exactly my situation...the system is a reservation system and I want to get the number of reservations before anything else happens...I could do this in a number of ways, of course, but right now I'm using a textbox on the form that checks the value and does not allow focus to leave the textbox until they enter a valid value - except if they ESCAPE out. They can't click on a combo, or anything else, except CANCEL button.
>>
>>J
>>
>>> My point actually was, that even if the control TabOrder is 1 on the form and this control has something in Valid method, we still can leave this control and go to another with mouse. Right now, however, I'm not so sure in this statement, so I need to make additional testing. At least, I noticed this behavior in some of my classes...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform