Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box Undesirable Behavior
Message
From
20/06/2003 13:10:17
 
 
To
20/06/2003 12:25:54
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00802210
Message ID:
00802306
Views:
30
Gee, I don't know. I'm hitting the arrow keys as fast as I can (though I'm not as young as I once was, so I may have lost a step or two). Do you have the same issue if you use the right and left arrow keys? With those keys you can hold them down indefinitely since they allow you to loop, and it can't get any faster than that.

Alan

>I have 6 items: 4 local printers and 2 network printers. However, I see it with only 3 too at times. Maybe I am keying too fast with the arrow keys? If I go slower, it works correctly.
>
>
>>Sorry Tracy, I've tried in both VFP7 and VFP8, and I cannot duplicate what you're seeing. No matter how many times I try it, it works just exactly like I expect it to. Maybe it has to do with the number of items? I have only 4 printers in my list. How many do you have? Does this happen on any alias? If you give me the number of items, I'll create a table with that number of records and retest.
>>
>>Alan
>>
>>>Thanks, I should take more care when creating down and dirty samples for testing. I tend to overlook the obvious if it is for testing only, but granted, things left out may create more problems.
>>>When I run the form and press the space bar in the combobox and scroll the items in the list, the first few times it all goes at it should with the value in the combobox updating as I scroll the list, but on subsequent times it is as though the cursor gets 'stuck' on the one of the items in the list and the same item will continually be highlited in the dropdown area as I press downarrow and uparrow but I can see the value change in the combobox. You do not see this? I see it in VFP7 and VfP8...
>>>
>>>>Tracy, I don't see the problem. The only time the hilight on the list and the displayvalue disagree for me is while I'm holding the arrow key down. Once I let go (KeyUp??), the system rights itself.
>>>>
>>>>Also, the following would make a nice addition to your sample code ;)
>>>>
>>>>PROCEDURE UNLOAD
>>>>   CLEAR EVENTS
>>>>ENDPROC
>>>>
>>>>
>>>>Alan
>>>>
>>>>>I have created a form for testing purposes to simulate some undesireable behavior I am experiencing with a combobox. In the form below, if the user clicks on the combo box and then uses the arrow keys to scroll, the first couple of times the arrow keys scroll the list as it should, but periodically the value will show one thing while the hilighted selection in the list shows another and it behaves erratic. This happens periodically when the user presses the spacebar to expand the combobox also, yet sometimes it scrolls at it should. Any suggestions anyone?
>>>>>
>>>>>
>>>>>oform=CREATEOBJECT('frmcombobox')
>>>>>oform.show
>>>>>READ EVENTS
>>>>>RETURN
>>>>>
>>>>>DEFINE CLASS frmcombobox AS form
>>>>>
>>>>>
>>>>>	DoCreate = .T.
>>>>>	Caption = "Test Combo Box Form"
>>>>>	Name = "comboform"
>>>>>	DIMENSION alist[1,1]
>>>>>
>>>>>
>>>>>	ADD OBJECT cbocn_port AS combobox WITH ;
>>>>>		FontSize = 10, ;
>>>>>		RowSourceType = 2, ;
>>>>>		RowSource = "printers.cprinter", ;
>>>>>		Value = (" "), ;
>>>>>		ControlSource = "m.cn_port", ;
>>>>>		Height = 24, ;
>>>>>		ColumnLines = .T., ;
>>>>>		Left = 36, ;
>>>>>		SelectOnEntry = .T., ;
>>>>>		StatusBarText = "Press CTRL+0 (zero) to clear contents and leave blank.", ;
>>>>>		Style = 2, ;
>>>>>		TabIndex = 7, ;
>>>>>		ToolTipText = "Press F1 to select from all available printer type.", ;
>>>>>		Top = 24, ;
>>>>>		Width = 300, ;
>>>>>		Name = "cboCn_port"
>>>>>
>>>>>
>>>>>	ADD OBJECT button1 AS commandbutton WITH ;
>>>>>		FontSize = 10, ;
>>>>>		Caption = 'Close',;
>>>>>		Height = 27, ;
>>>>>		Left = 36,;
>>>>>		Top = 134,;
>>>>>		Name = 'cmdclose'
>>>>>
>>>>>	ADD OBJECT text1 AS textbox WITH ;
>>>>>		ControlSource = "m.cn_port", ;
>>>>>		Height = 23, ;
>>>>>		Left = 36, ;
>>>>>		ReadOnly = .T., ;
>>>>>		TabStop = .F., ;
>>>>>		Top = 84, ;
>>>>>		Width = 300, ;
>>>>>		Name = "Text1"
>>>>>
>>>>>
>>>>>	PROCEDURE Release
>>>>>		IF USED('PRINTERS')
>>>>>			USE IN PRINTERS
>>>>>		ENDIF
>>>>>		CLEAR EVENTS
>>>>>		DODEFAULT()
>>>>>	ENDPROC
>>>>>
>>>>>
>>>>>	PROCEDURE Load
>>>>>		IF TYPE('hdir')="U"
>>>>>			hdir = LEFT(SYS(2005),RAT("\",SYS(2005)))
>>>>>		ENDIF
>>>>>		PRIVATE lcalias
>>>>>		lcalias=""
>>>>>		lcalias=ALIAS()
>>>>>		PRIVATE myname
>>>>>		myname=hdir+'printers.dbf'
>>>>>		SET SAFETY OFF
>>>>>		SELE 0
>>>>>		CREATE TABLE (myname) (cprinter c(60))
>>>>>		IF !EMPTY(lcalias)
>>>>>			SELECT (lcalias)
>>>>>		ENDIF
>>>>>
>>>>>
>>>>>	PROCEDURE Init
>>>>>		IF TYPE('m.cn_port')="U"
>>>>>			PUBLIC m.cn_port
>>>>>			m.cn_port=""
>>>>>		ENDIF
>>>>>		*--Create an array with all windows printers
>>>>>		PRIVATE m.numOfPrinters
>>>>>		m.numOfPrinters = APRINTERS(printerList)
>>>>>		IF m.numOfPrinters  > 0
>>>>>			DIMENSION THIS.alist[Alen(printerlist, 1), 2]
>>>>>			LOCAL m.i
>>>>>			FOR m.i = 1 TO ALEN(printerList, 1)
>>>>>				LOCAL printerName
>>>>>				m.printerName=" "+printerList[m.i, 1]
>>>>>				* m.printerName = Strtran(printerList[m.i, 1], "\", " \")
>>>>>				THIS.alist[m.i, 1] = m.printerName
>>>>>			NEXT
>>>>>		ENDIF
>>>>>		*--Copy array to a local table for use in combobox picklists
>>>>>		PRIVATE lcalias
>>>>>		lcalias=""
>>>>>		lcalias=ALIAS()
>>>>>		SET SAFETY OFF
>>>>>		SELE 0
>>>>>		SELE printers
>>>>>		PRIVATE ia
>>>>>		FOR ia = 1 TO ALEN(THIS.alist,1)
>>>>>			SELE printers
>>>>>			APPEND BLANK
>>>>>			REPLACE printers.cprinter WITH THIS.alist(ia,1)
>>>>>		ENDFOR
>>>>>		IF !EMPTY(lcalias)
>>>>>			SELECT (lcalias)
>>>>>		ENDIF
>>>>>		**********************************************************
>>>>>	ENDPROC
>>>>>
>>>>>	PROCEDURE cmdclose.click
>>>>>		THISFORM.release
>>>>>	ENDPROC
>>>>>
>>>>>	PROCEDURE cbocn_port.LostFocus
>>>>>		ON KEY LABEL F1
>>>>>		IF ISNULL(THISFORM.cbocn_port.Value) .or. ISNULL(m.cn_port)
>>>>>			THISform.cbocn_port.Value=""
>>>>>			Thisform.cbocn_port.Refresh()
>>>>>			m.cn_port=thisform.cbocn_port.value
>>>>>		ENDIF
>>>>>		DODEFAULT()
>>>>>	ENDPROC
>>>>>
>>>>>
>>>>>	PROCEDURE cbocn_port.GotFocus
>>>>>		ON KEY LABEL SPACEBAR
>>>>>		ON KEY LABEL F1 KEYBOARD '{SPACEBAR}'
>>>>>		DODEFAULT()
>>>>>	ENDPROC
>>>>>
>>>>>
>>>>>	PROCEDURE cbocn_port.InteractiveChange
>>>>>		m.cn_port=this.value
>>>>>		THISFORM.text1.refresh
>>>>>		DODEFAULT()
>>>>>	ENDPROC
>>>>>
>>>>>
>>>>>ENDDEFINE
>>>>>*
>>>>>*-- EndDefine: frmcombobox
>>>>>**************************************************
>>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform