Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Erasing a combobox's memory
Message
 
À
13/07/2005 16:44:59
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01032369
Message ID:
01032531
Vues:
15
Elyse, this works for me:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


	**************************************************
*-- Form:         form1 (d:\all_zapl\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   07/14/05 11:08:08 AM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT optiongroup1 AS optiongroup WITH ;
		ButtonCount = 2, ;
		Value = 1, ;
		Height = 46, ;
		Left = 10, ;
		Top = 12, ;
		Width = 134, ;
		Name = "Optiongroup1", ;
		Option1.Caption = "Group 1", ;
		Option1.Value = 1, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Top = 5, ;
		Option1.Width = 61, ;
		Option1.Name = "Option1", ;
		Option2.Caption = "Group 2", ;
		Option2.Height = 17, ;
		Option2.Left = 5, ;
		Option2.Top = 24, ;
		Option2.Width = 61, ;
		Option2.Name = "Option2"


	ADD OBJECT combo1 AS combobox WITH ;
		BoundColumn = 2, ;
		RowSourceType = 3, ;
		RowSource = "SELECT cTest1.Field1, Field2 FROM cTest1 WHERE Group1 = 1 INTO CURSOR cccTest", ;
		Height = 24, ;
		Left = 151, ;
		Style = 2, ;
		Top = 16, ;
		Width = 213, ;
		BoundTo = .T., ;
		Name = "Combo1"


	PROCEDURE Load
		CREATE CURSOR cTest1 (Field1 C(10), Field2 C(2), Group1 N(1))
		FOR asd = 1 TO 10
		    INSERT INTO cTest1 VALUES ("Name "+TRANSFORM(asd), PADL(TRANSFORM(asd),2,"0"), 1)
		NEXT
		FOR asd = 1 TO 10
		    INSERT INTO cTest1 VALUES ("Name "+TRANSFORM(asd+64), CHR(asd+64), 2)
		NEXT
	ENDPROC


	PROCEDURE optiongroup1.InteractiveChange
		thisform.Combo1.RowSource = "SELECT cTest1.Field1,cTest1.Field2 FROM cTest1 WHERE Group1 = "+TRANSFORM(this.Value)+" INTO CURSOR cccTest"
		thisform.Combo1.Requery()
		thisform.Combo1.value = ""
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
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
Répondre
Fil
Voir

Click here to load this message in the networking platform