Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with combo box
Message
From
31/08/2002 08:50:28
 
 
To
30/08/2002 16:40:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00695562
Message ID:
00695642
Views:
20
I need a combo box based on two fields of a view (namel,namef) order by namel,user should be able to type in few characters of lastname(namel) and it should point to location in combo and when user clicks it should get selected.

You do not say what problems you are having, but why dont you set the combo up like this:

RowSourceType = 3-SQL
RowSource = "SELECT Namel, Namef FROM < MyTable > ORDER BY Namel INTO CURSOR Junk NOFILTER"
Style = 2-Drop Down List

Then, add a property called nOldIncSeek to your combo class. You need code like this in the combo's GotFocus() to facilitate incrememntal search:
WITH This
  *** Save Original value in case we have to restore it later
  .uOldVal = .Value
  *** Facilitate incremental searching in the drop down
  IF VERSION( 5 ) > 699
    *** We are in VFP 7.0 or later
    .nOldIncClick = _INCSEEK
    _INCSEEK = 1.5
  ELSE    
    .nOldIncClick = _DBLCLICK
    _DBLCLICK = 1.5
  ENDIF
ENDWITH
And, of course, you need the appropriate code in the combo class's LostFocus() to ensure that you clean up after yourself and reset _INCSEEK to its original value.
Previous
Reply
Map
View

Click here to load this message in the networking platform