Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox - Click vs Keypress
Message
 
To
31/08/2010 12:31:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01479450
Message ID:
01479470
Views:
41
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform