Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CifComboBox wont lose focus
Message
From
19/02/2004 11:26:21
Steven Kleypas
Tarrant County College District
Texas, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
CifComboBox wont lose focus
Miscellaneous
Thread ID:
00878754
Message ID:
00878754
Views:
54
I am having a problem with a MM incremental search control (cifCombBox) not losing focus once a selection has been made. Upon selection, pressing Enter causes the cursor to move back to the first character in the combobox, making it impossible to leave it for another form control.

Tracing through all of the code shows that pressing Enter causes the Keypress event to be executed momentarily and then the LostFocus event code fires. In another scenario, I put SET STEP ON in the Lostfocus event to follow the code. If SET STEP IS ON, and each line of code is executed in the Trace window, the cursor moves to the next control as it should. If I take the SET STEP ON line out, (and Trace window is not open) the cursor returns to the textbox portion of the combobox.

Another interesting part of this is entering text that is not in the dropdown list, causing an "Add form" to be executed. Enter must be pressed twice to get the form to execute. Once the "Add form" is completed, pressing OK adds a new record to the underlying cursor, the new selection is added to the list and the cursor advances to the next control as it should.

None of the event code in this control has been altered, but several of the controls custom properties were changed to public rather than protected because they were going out of scope in the lostfocus event. Other changes:

Control .Init
This.RowSource = 'SELECT cAgencyName AS cAgencyName,iID AS iID ' + ;
'FROM v_Agency ' + ;
'ORDER BY cAgencyName ' + ;
'INTO CURSOR cAgencies '
DODEFAULT()

Control Properties
.ControlSource = v_students.iAgencyId
.RowSourceType = 3 - SQL Statement
.BoundColumn = 2
.BoundTo = .T.
.cFormName = "AgencyAddForm"
.cTag = "AgencyName"
.lCaseSensitive = .F.
.lLimitToList = .F.


I know this is lengthy, but have spent hours (days actually) tring to make this thing work. Any ideas?
Reply
Map
View

Click here to load this message in the networking platform