Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dropdown list positioned at end of list
Message
 
 
À
24/05/2006 10:38:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01124526
Message ID:
01124530
Vues:
9
Try,
PROCEDURE combo1.KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
DO CASE
CASE nKeyCode = 24 AND This.Listindex <> 1
	KEYBOARD '{UPARROW}' PLAIN CLEAR
	NODEFAULT
CASE nKeyCode = 5 AND This.Listindex = 1
	KEYBOARD '{DNARROW}' PLAIN CLEAR
	NODEFAULT
ENDCASE	
ENDPROC
>
>a client of mine has created a combo (dropdown list) that is bound to a 1 character field to indicate 1 is yes and 0 is no. The complaint is that when the user tabs into the combo, they have to press the up arrow to select Yes or No, whereas they expect to press the Down arrow. Here's some code which illustrates the problem. The first combo shows the problem, the second combo illustrates how they expect it to work, but the problem is that they can then leave a blank entry in the combo.
>
>
>CREATE CURSOR combo;
>(yesno C(1),;
>yesno2 C(1))
>
>APPEND BLANK
>
>oForm = CREATEOBJECT('form1')
>oForm.Show()
>
>
>DEFINE CLASS form1 AS form
>
>
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>	windowtype = 1
>
>
>	ADD OBJECT combo1 AS combobox WITH ;
>		BoundColumn = 2, ;
>		ColumnCount = 2, ;
>		ColumnWidths = "50,0", ;
>		RowSourceType = 1, ;
>		RowSource = "Yes,1,No,0", ;
>		ControlSource = "combo.yesno", ;
>		Height = 24, ;
>		Left = 52, ;
>		Style = 2, ;
>		Top = 40, ;
>		Width = 100, ;
>		Name = "Combo1"
>
>
>	ADD OBJECT combo2 AS combobox WITH ;
>		BoundColumn = 2, ;
>		ColumnCount = 2, ;
>		ColumnWidths = "50,0", ;
>		RowSourceType = 1, ;
>		RowSource = ",,Yes,1,No,0", ;
>		ControlSource = "combo.yesno2", ;
>		Height = 24, ;
>		Left = 52, ;
>		Style = 2, ;
>		Top = 76, ;
>		Width = 100, ;
>		BoundTo = .T., ;
>		Name = "Combo2"
>
>
>ENDDEFINE
>
>
>Anyone have any ideas how to sort this out?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform