Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disabling Text & List Boxes
Message
De
20/05/2003 13:21:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00790515
Message ID:
00790629
Vues:
18
Hi,


>I have form with 2 text boxes and 2 list boxes. On the same form I have an >option group. When I select the second option I want the 2 text boxes and 2 >list boxes to grey out (Disable)

>I have tried

>IF thisform.option1.value=1 then
>thisform.text1.enable=.F.
>thisform.text2.enable=.F.
>thisform.List1.enable=.F.
>thisform.List2.enable=.F.
>else
>endif


If you want these controls disabled when the second option is chosen then you need to check for .value = 2 :
LOCAL llEnable
WITH thisform
  llEnable = !(.option1.value=2) 
  .text1.enabled = llenable
  .text2.enabled = llenable
  .list1.enabled = llenable
  .list2.enabled = llenable
ENDWITH
(but I suspect you just made a typo)

Since there are several situations where this code might need to be run (especially if the OptionGroup is bound) I'd put it in its own form method (or maybe in the form.refresh). The form's init() as well as the optiongroups Interactive and Programmatic change events should all run it.

Regards,
Viv
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform