Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checkbox - Click vs Keypress
Message
 
À
31/08/2010 12:31:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01479450
Message ID:
01479470
Vues:
42
>Contrary to popular belief, there are three states that a checkbox can have:
>
>- Checked
>- Unchecked
>- Undertermined
>
>When you click, you only get the first two states. When you use the spacebar, you can get all three.
>
>You can fix with with code in the KeyPress event:
>
>IF (nKeyCode = 32)
>    This.Value = !This.Value
>    ThisForm.Refresh()
>ENDIF
>
>
>The code to enable/disable other controls should be moved to the Form.Refresh method.
>
>This.txtlimitedby.Enabled = This.Chkbox.Value
>This.limiteddays.Enabled = This.Chkbox.Value
>
>
>

Turns out it was a corrupted checkbox on the form.... sigh...

Went in and deleted it, created a new one, used this code in the Click...
IF this.Value = .T.
	Thisform.pgf1.page1.txtlimitedby.Enabled = .T.
	Thisform.pgf1.page1.lbllimiteddays.Enabled = .T.
ELSE
	Thisform.pgf1.page1.txtlimitedby.Enabled = .F.
	Thisform.pgf1.page1.lbllimiteddays.Enabled = .F.
ENDIF 
And all is well again! Mouse and Spacebar both work as they should....

Thanks!
Tommy Tillman A+ NetWork+ MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform