Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use Optiongroup with logical data?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01187180
Message ID:
01187212
Vues:
23
FWIW, it does work if you put code in the form's Refresh() to set the OptionButton values based on the field value,
IF myfield = .t.
	thisform.optiongroup3.option1.Value = 1
	thisform.optiongroup3.option2.Value = 0
ELSE
	thisform.optiongroup3.option2.Value = 1
	thisform.optiongroup3.option1.Value = 0
ENDIF
and more code in the OptionGroup.InteractiveChange method to modify the field if the Optionbuttons have changed.
DO CASE
CASE this.option1.Value = 1 AND myfield= .f.  && Yes button
	replace myfield WITH .t.
CASE this.option2.Value = 1 AND myfield = .t.  && No button
	replace myfield WITH .f.
OTHERWISE
	* field doesn't need changing
ENDCASE
			
thisform.Refresh()
But without bound data, the control is just a flag. It seems like there ought to be a better way--and there probably is: it's called a checkbox, but the client wants OptionButtons (and they're going to pay for them!)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform