Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox display question
Message
De
17/01/2006 16:08:19
 
 
À
17/01/2006 13:02:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01087631
Message ID:
01087726
Vues:
9
>Using VFP8. I have a combobox with SQL statement rowsource. it is select col1, col2 ..
>
>I want the combobox to show col2 when it is closed but to show col1,col2 when it is oppened (dropped) in that order.
>It only shows col1 when it is closed. I thought the setting the DisplayValue will fix this problem but I can not even set the DisplayValue.
>
>So, is there a way to show col2 when the combobox is closed and show col1, col2 when it is open???
>
>Thanks
>Mo

the combobox is not efficient, but if you satisfy yourself
( too hard to add a displaycolum baseclass's property !)
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show

DEFINE CLASS form1 AS form

	ADD OBJECT combo1 AS combobox WITH ;
		BoundColumn = 2, ;
		ColumnCount = 3, ;
		ColumnWidths = "0", ; && or "0,100,100"
		RowSourceType = 3, ;
		RowSource = "SELECT F2,F1,F2 FROM BYBY INTO CURSOR COMBO", ;
		Left = 120, ;
		Style = 2, ;
		Top = 36, ;
		Width = 205, ;
		BoundTo = .T., ;
		Name = "Combo1"


	PROCEDURE Load
		CREATE CURSOR byby (f1 c(20) DEFAULT PADC('_'+TRANS(RECCOUNT()),16,'1'),f2 c(30) DEFAULT PADC('_'+TRANS(RECCOUNT()),16,'2'))
		FOR k=1 TO 30
			APPEND BLANK 
		NEXT
	ENDPROC


ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform