Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox
Message
 
To
25/07/2005 12:27:57
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Miscellaneous
Thread ID:
01035748
Message ID:
01035751
Views:
11
>How do I set a check box to checked in code. For example thisform.check1.Value = 1 in FPW2.6 for windows?
>
>THanks
>
>Paul

Paul,

In the screen generator you have an option to set it as "Initially Checked", by code you set the controlling memvar to .t. or 1 for having it checked or to .f. or 0 for having it unchecked.


As a sample, this is the code genereated for a screen with just one checkbox
*       *********************************************************
*       *                                                         
*       * 07/25/2005            TEST26.SPR               09:34:46 
*       *                                                         
*       *********************************************************
*       *                                                         
*       * Author's Name                                           
*       *                                                         
*       * Copyright (c) 2005 Company Name                         
*       * Address                                                 
*       * City,     Zip                                           
*       *                                                         
*       * Description:                                            
*       * This program was automatically generated by GENSCRN.    
*       *                                                         
*       *********************************************************


#REGION 0
REGIONAL m.currarea, m.talkstat, m.compstat

IF SET("TALK") = "ON"
	SET TALK OFF
	m.talkstat = "ON"
ELSE
	m.talkstat = "OFF"
ENDIF
m.compstat = SET("COMPATIBLE")
SET COMPATIBLE FOXPLUS

m.rborder = SET("READBORDER")
SET READBORDER ON

m.currarea = SELECT()


*       *********************************************************
*       *                                                         
*       *               Windows Window definitions                
*       *                                                         
*       *********************************************************
*

IF NOT WEXIST("_1kp0kj6dd")
	DEFINE WINDOW _1kp0kj6dd ;
		AT  0.000, 0.000  ;
		SIZE 22.000,98.400 ;
		FONT "MS Sans Serif", 8 ;
		FLOAT ;
		NOCLOSE ;
		MINIMIZE ;
		SYSTEM
	MOVE WINDOW _1kp0kj6dd CENTER
ENDIF


*       *********************************************************
*       *                                                         
*       *          TEST26/Windows Setup Code - SECTION 2          
*       *                                                         
*       *********************************************************
*

#REGION 1
m.test=.t.

*       *********************************************************
*       *                                                         
*       *              TEST26/Windows Screen Layout               
*       *                                                         
*       *********************************************************
*

#REGION 1
IF WVISIBLE("_1kp0kj6dd")
	ACTIVATE WINDOW _1kp0kj6dd SAME
ELSE
	ACTIVATE WINDOW _1kp0kj6dd NOSHOW
ENDIF
@ 3.769,12.000 GET m.test ;
	PICTURE "@*C Test" ;
	SIZE 1.308,8.667 ;
	DEFAULT 0 ;
	FONT "MS Sans Serif", 8 ;
	STYLE "BT"

IF NOT WVISIBLE("_1kp0kj6dd")
	ACTIVATE WINDOW _1kp0kj6dd
ENDIF

READ CYCLE

RELEASE WINDOW _1kp0kj6dd
SELECT (m.currarea)


#REGION 0

SET READBORDER &rborder

IF m.talkstat = "ON"
	SET TALK ON
ENDIF
IF m.compstat = "ON"
	SET COMPATIBLE ON
ENDIF
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform