Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Am I wrong? About Bindevent() with Grid control
Message
 
À
24/06/2005 03:05:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01026174
Message ID:
01026191
Vues:
20
Value is not an event to be bound, Bind Click instead
BINDEVENT(.chk1,"Click",thisform,"cnt_sel",1)


>Funny,try to run the codes below:
>
>ofrm=NEWOBJECT("frmbindeventtest" )
>ofrm.show(1)
>
>DEFINE CLASS frmbindeventtest AS form
>
>
>	Top = 0
>	Left = 0
>	Height = 343
>	Width = 585
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>
>	ADD OBJECT grid1 AS grid WITH ;
>		Height = 226, ;
>		Left = 38, ;
>		Top = 38, ;
>		Width = 444, ;
>		Name = "Grid1"
>
>
>	ADD OBJECT command1 AS commandbutton WITH ;
>		Top = 279, ;
>		Left = 429, ;
>		Height = 32, ;
>		Width = 91, ;
>		Caption = "Close", ;
>		Name = "Command1"
>
>
>	ADD OBJECT text1 AS textbox WITH ;
>		Height = 28, ;
>		Left = 52, ;
>		Top = 274, ;
>		Width = 78, ;
>		Name = "Text1"
>
>
>	PROCEDURE cnt_sel
>		SELECT tmp_sel
>		nrec=RECNO()
>		COUNT TO thisform.text1.Value FOR sel
>		IF nrec>1
>		    GO nrec
>		ENDIF
>		 thisform.refresh
>	ENDPROC
>
>
>	PROCEDURE Init
>		CREATE CURSOR tmp_sel (sel l,name c(20),seq int)
>		INSERT INTO tmp_sel VALUES (.T.,"ABCD",1)
>		INSERT INTO tmp_sel VALUES (.T.,"ABCD",2)
>		INSERT INTO tmp_sel VALUES (.T.,"ABCD",3)
>		INSERT INTO tmp_sel VALUES (.T.,"ABCD",4)
>		INSERT INTO tmp_sel VALUES (.T.,"ABCD",5)
>		INSERT INTO tmp_sel VALUES (.T.,"ABCD",6)
>		SELECT tmp_sel
>		GO TOP
>		With  thisform.grid1
>			.RecordSource  = [tmp_sel]
>			.ColumnCount =3
>		.column1.header1.Caption = 'SELECT'
>		.column2.header1.Caption = 'Name'
>		.column3.header1.Caption = 'Sequence'
>
>
>		.column1.ControlSource = 'tmp_sel.sel'
>		.column2.ControlSource = 'tmp_sel.name'
>		.column3.ControlSource = 'tmp_sel.seq'
>
>
>		.column1.width=50
>		.column2.width=100
>		.column2.width=50
>		  WITH .column1
>		                .readonly=.f.
>		                .sparse=.f.
>			         .addobject([chk1],"checkbox")
>			         .currentcontrol=[chk1]
>			         WITH .chk1
>		      	       .autosize=.f.
>		      	       .caption=''
>			       .Visible=.T.
>			       .readonly=.f.
>			       ENDWITH
>		          BINDEVENT(.chk1,"value",thisform,"cnt_sel",1) && Key code
>		 ENDWITH
>		ENDWITH
>	ENDPROC
>
>	PROCEDURE command1.Click
>		thisform.Release
>	ENDPROC
>ENDDEFINE
>
>HTH
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform