Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ComboBox Row Limitations
Message
De
28/02/2009 06:49:54
 
 
À
27/02/2009 17:22:55
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01384116
Message ID:
01384750
Vues:
188
>>>I changed a little of your code (below), ran it against our zip code table (43,000 records) with a RowSourceType of Alias, and I can reproduce the problem. If you select one of the top records (value changes), then drag the scroll bar down and select one of the bottom records (value usually changes), then drag back up to select a top record, the value does not change. I have done this also on a table/cursor that only had 300 records as well. I am using VFP9 SP2.
>>>
>>
>>1. Are you sure that the 2th column have not duplicated values ?
>
>Of course it does; they are cities. Cities have multiple zip codes.
>
With duplicated Values every Value/ControlSource Refresh
set ListIndex to the first match row
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show

DEFINE CLASS form1 AS form


	Top = 0
	Left = 0
	Height = 250
	Width = 453
	DoCreate = .T.
	Caption = "Form1"
	Name = "form1"


	ADD OBJECT combo1 AS combobox WITH ;
		BoundColumn = 2, ;
		ColumnCount = 2, ;
		RowSourceType = 5, ;
		Height = 24, ;
		Left = 96, ;
		Style = 2, ;
		Top = 60, ;
		Width = 156, ;
		BoundTo = .T., ;
		Name = "Combo1"


	ADD OBJECT text1 AS textbox WITH ;
		ControlSource = "thisform.Combo1.Value", ;
		Height = 23, ;
		InputMask = "99999999", ;
		Left = 264, ;
		Top = 60, ;
		Width = 156, ;
		Name = "Text1"


	ADD OBJECT check1 AS checkbox WITH ;
		Top = 24, ;
		Left = 96, ;
		Height = 17, ;
		Width = 138, ;
		AutoSize = .T., ;
		Alignment = 0, ;
		Caption = "Rewrite Combo Value", ;
		Value = .T., ;
		Name = "Check1"


	PROCEDURE combo1.Valid
		IF thisform.Check1.Value
			this.Value = this.Value
		ENDIF
		thisform.Text1.Refresh
	ENDPROC


	PROCEDURE combo1.Init
		ADDPROPERTY(this,"aItems[256,2]")
		FOR j=1 TO ALEN(this.aItems,1)
			This.aItems[m.j,1]="Items"+STR(m.j)
			This.aItems[m.j,2]=34
		NEXT
		this.RowSource = "m.this.aItems"
		this.Value = 34
	ENDPROC


ENDDEFINE
>>2. try without ORDER Zip_code
>
>Same problem.
>
>>3. Try with RowSourceType = 3
>
>Same problem.
>
>>>>
>>>PUBLIC oform1
>>>
>>>oform1=NEWOBJECT("form1")
>>>oform1.Show
>>>
>>>CLOSE DATABASES 
>>>
>>>USE "c:\FMSRun\Prompt\Zip_Code" IN 0 ORDER Zip_Code
>>>
>>>DEFINE CLASS form1 AS form
>>>
>>>
>>>	Top = 0
>>>	Left = 0
>>>	Height = 250
>>>	Width = 453
>>>	DoCreate = .T.
>>>	Caption = "Form1"
>>>	Name = "Form1"
>>>
>>>
>>>	ADD OBJECT combo1 AS combobox WITH ;
>>>		BoundColumn = 2, ;
>>>		ColumnCount = 2, ;
>>>		RowSourceType = 5, ;
>>>		Height = 24, ;
>>>		Left = 96, ;
>>>		Style = 2, ;
>>>		Top = 60, ;
>>>		Width = 156, ;
>>>		BoundTo = .T., ;
>>>		Name = "Combo1"
>>>
>>>
>>>	ADD OBJECT text1 AS textbox WITH ;
>>>		ControlSource = "thisform.Combo1.Value", ;
>>>		Height = 23, ;
>>>		InputMask = "99999999", ;
>>>		Left = 264, ;
>>>		Top = 60, ;
>>>		Width = 156, ;
>>>		Name = "Text1"
>>>
>>>
>>>	ADD OBJECT combo2 AS combobox WITH ;
>>>		BoundColumn = 2, ;
>>>		ColumnCount = 2, ;
>>>		RowSourceType = 5, ;
>>>		Height = 24, ;
>>>		Left = 96, ;
>>>		Style = 2, ;
>>>		Top = 96, ;
>>>		Width = 156, ;
>>>		BoundTo = .T., ;
>>>		Name = "Combo2"
>>>
>>>
>>>	ADD OBJECT text2 AS textbox WITH ;
>>>		ControlSource = "thisform.Combo2.Value", ;
>>>		Height = 23, ;
>>>		InputMask = "99999999", ;
>>>		Left = 264, ;
>>>		Top = 96, ;
>>>		Width = 156, ;
>>>		Name = "Text2"
>>>
>>>
>>>*		RowSourceType = 5, 
>>>
>>>	ADD OBJECT combo3 AS combobox WITH ;
>>>		BoundColumn = 2, ;
>>>		ColumnCount = 2, ;
>>>		RowSourceType = 2, ;
>>>		Height = 24, ;
>>>		Left = 96, ;
>>>		Style = 2, ;
>>>		Top = 132, ;
>>>		Width = 156, ;
>>>		BoundTo = .T., ;
>>>		Name = "Combo3"
>>>
>>>
>>>	ADD OBJECT text3 AS textbox WITH ;
>>>		ControlSource = "thisform.Combo3.Value", ;
>>>		Height = 23, ;
>>>		InputMask = "99999999", ;
>>>		Left = 264, ;
>>>		Top = 132, ;
>>>		Width = 156, ;
>>>		Name = "Text3"
>>>
>>>
>>>	PROCEDURE combo1.Init
>>>		ADDPROPERTY(this,"aItems[256,2]")
>>>		FOR j=1 TO ALEN(this.aItems,1)
>>>			This.aItems[m.j,1]="Items"+STR(m.j)
>>>			This.aItems[m.j,2]=m.j+20
>>>		NEXT
>>>		this.RowSource = "m.this.aItems"
>>>		this.Value = 34
>>>	ENDPROC
>>>
>>>
>>>	PROCEDURE combo1.Valid
>>>		thisform.Text1.Refresh
>>>	ENDPROC
>>>
>>>
>>>	PROCEDURE combo2.Valid
>>>		thisform.Text2.Refresh
>>>	ENDPROC
>>>
>>>
>>>	PROCEDURE combo2.Init
>>>		ADDPROPERTY(this,"aItems[256,2]")
>>>		FOR j=1 TO ALEN(this.aItems,1)
>>>			This.aItems[m.j,1]="Items"+STR(m.j)
>>>			This.aItems[m.j,2]=-m.j
>>>		NEXT
>>>		this.RowSource = "m.this.aItems"
>>>		this.Value = -34 && with negatives you can select but set Value doesn't find Value into RowSource
>>>	ENDPROC
>>>
>>>
>>>	PROCEDURE combo3.Valid
>>>		thisform.Text3.Refresh
>>>	ENDPROC
>>>
>>>
>>>	PROCEDURE combo3.Init
>>>		ADDPROPERTY(this,"aItems[100000,2]")
>>>		FOR j=1 TO ALEN(this.aItems,1)
>>>			This.aItems[m.j,1]="Items"+STR(m.j)
>>>			This.aItems[m.j,2]=m.j
>>>		NEXT
>>>*		this.RowSource = "m.this.aItems"
>>>		this.RowSource = "Zip_Code.Zip_Code,City"
>>>		this.Value = 234
>>>	ENDPROC
>>>
>>>
>>>ENDDEFINE
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform