Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to disable tab key
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00124536
Message ID:
00125065
Views:
30
>I see that. How is the method invoked. I've done all my programming to this point by manipulating the events on controls. when you said:
>
>"I'd write a form method disabling and enabling the cmdbuttons. The disable version would be called when either textbox1 or textbox2 is live. Re-enabling is called from the VALID or LOSTFOCUS methods, but ONLY if there were good values in both textboxes."
>do you mean you'd process the events for the controls thru the form method?
>By hard coding using code like "setall." ..." etc?

You call a form method you've added the same way you call any other event/method. In your VALID method for BOTH the textboxes you'd put
Thisform.SetButton()
return .t.

** SetButton Method
if !empty(Thisform.textbox1.value ) .and. !empty(thisform.textbox2.value)
   Thisform.Button1.enabled = .t.
   ....
else
   Thisform.Button1.enabled = .f.
   ....
endif
The same code is called from both (or more) textboxes. You can even pass parameters so the buttons could be set differently under different circumstances, but using the same method code.

Hope this makes it a little clearer.

Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform