Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with Combo boxes
Message
De
02/10/2002 23:27:55
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00707177
Message ID:
00707202
Vues:
28
>
>How big is the real field that you want to try and bind the cbo to? Why are you using a cbo and not a textbox? cbo is most often bound to a simple integer field that is a foreign key into a lookup table.
>
David,

We are binding it to a integer controlsource using a character display source. The sample code below shows the problem (You can type 71 characters into the combo box).

There is the messagebox in the lostfocus to show that it is losing focus at that point.

Cheers,

Chris
DEFINE CLASS cboproblem AS form


	Top = 0
	Left = 0
	Height = 130
	Width = 535
	DoCreate = .T.
	Caption = "Form1"
	cbosource = 0
	Name = "Form1"


	ADD OBJECT combo1 AS combobox WITH ;
		BoundColumn = 2, ;
		Height = 24, ;
		Left = 12, ;
		Top = 12, ;
		Width = 384, ;
		Name = "Combo1"


	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 12, ;
		Top = 48, ;
		Width = 372, ;
		Name = "Text1"


	PROCEDURE Init
		CREATE CURSOR crsTesting (CharField C(200), IntField I)
		SELECT crsTesting


		INSERT INTO crsTesting (CharField, IntField) VALUES ("", 0)
		INSERT INTO crsTesting (CharField, IntField) VALUES ("Test 1", 1)
		INSERT INTO crsTesting (CharField, IntField) VALUES ("Test 2", 2)
		INSERT INTO crsTesting (CharField, IntField) VALUES ("Test 3", 3)
		INSERT INTO crsTesting (CharField, IntField) VALUES ("Test 4", 4)
		INSERT INTO crsTesting (CharField, IntField) VALUES ("Test 5", 5)
		INSERT INTO crsTesting (CharField, IntField) VALUES ("Test 6", 6)

		THISFORM.Combo1.ControlSource = "THISFORM.cboSource"


		THISFORM.Combo1.RowSourceType = 2
		THISFORM.Combo1.RowSource = "crsTesting"
	ENDPROC


	PROCEDURE combo1.LostFocus
		MessageBox("Lost Focus")
	ENDPROC


ENDDEFINE
Have a nice day :)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform